Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1
Chapter 3 ■ advanCed 3d Content rendering: 3d asset ConCepts and prinCiples

As time goes on, ideally JavaFX 9 will add more texture channel support and give developers more
visual flexibility regarding their 3D new media asset usage, as transparency areas (opacity maps) and surface
details (normal map) are two of the most important areas regarding advanced texture mapping support.
These will ultimately need to be added to Java using the JavaFX API in order for developers to be able to
create realistic i3D models for Java games.
The collection of texture channels and any code governing these channels’ relationship to each other,
as well as how they will be composited, applied, and rendered relative to each other, is called the shader
definition. Shaders are also commonly referred to as materials in the 3D industry. We will be covering
shaders and shader languages, as this is another specialized and complex area of 3D and i3D games
development, in the next section of this chapter. I also go into shader construction in detail in my book VFX
Fundamentals (Apress, 2016) using open source Fusion 8.2.1.
Finally, once your textures are defined inside the shaders, you will need to orient these 2D assets to
your 3D geometry, which is done by using texture mapping coordinates, usually done via something called
UVW mapping, which we will also be covering in its own specific section, before we move on to the fourth
dimension and animation.


Texture Map Design: Shader Channels and Shader Language


Shader design is an art form in and of itself; thousands of shader artists work on 3D movies, games, and
television shows making sure that the shaders used to “shade” or “skin” the 3D geometry make the resulting
3D model look as real as possible, which is often the objective of 3D, to replace more expensive video camera
shoots (and reshoots).
The basic shader consists of a series of 2D vector shapes, 2D raster images, or volumetric textures,
held in different types of channels that apply different types of effects, such as diffuse (color), specular
(shininess), glow (illumination), bump (topography), normal (height), opacity (transparency), and
environmental (surroundings) maps. Volumetric shaders are also 3D in nature and as such do not use


Figure 3-4. Using a Scene Graph (right) to apply a gold texture map and shader (bottom) to a sphere object in
Blender

Free download pdf