Emissive component for PhongMaterial

Kevin Rushforth kevin.rushforth at oracle.com
Mon Apr 15 12:36:45 UTC 2019


A doubling of the number of shaders was what I was hoping you could 
avoid (else I question the value proposition of doing this). I haven't 
looked at the logic recently, but my thought when I initially replied 
was that you could use the "self-illum" shaders if either the self-illum 
map was non-null or the new emissive component was non-zero. You would 
probably need to pass in a pre-computed map of all 0s in the case where 
emissive is used, but self-illum map is not.

-- Kevin


On 4/13/2019 10:07 AM, Nir Lisker wrote:
> This might not be as simple as I thought. Even though adding the 
> self-illumination color naively works, I suspect I need to add new 
> blend modes for the combinations of the self-illumination color and 
> the map. That is, in D3DPhongShader.h, 'SelfIlllumTotal = 2' should be 
> replaced with an enum and get the same treatment the specular 
> component gets. This means the number of pixelShaders doubles and many 
> blending combinations (the ShaderFunction functions) are added, which 
> need to be generated via the build.gradle file.
>
> Is this correct?
>
> On Wed, Apr 10, 2019 at 1:54 PM Kevin Rushforth 
> <kevin.rushforth at oracle.com <mailto:kevin.rushforth at oracle.com>> wrote:
>
>     Hi Nir,
>
>     It seems like a straight-forward addition. On the one hand, an
>     application can use the self-illumination map to accomplish the same
>     thing. However, a separate emissive color does allow changing it
>     without
>     creating a new 1x1 image each time, and makes it possible to
>     combine a
>     self-illumination map with a modulating emissive color without
>     combining
>     the two in the application, so I can see it being a nice convenience.
>     Presuming there is no measurable performance hit, this seems fine
>     to me.
>
>     -- Kevin
>
>
>     On 4/10/2019 3:01 AM, Nir Lisker wrote:
>     > Hi Johan/Kevin,
>     >
>     > Iv'e submitted an issue for adding an emissive component to
>     PhongMaterial
>     > [1].
>     > This component is the single-color counterpart of the
>     self-illumination
>     > map. It functions the same way as diffuse color is to diffuse
>     map and
>     > specular color is to specular map.
>     > Emissive colors are used to simulate an object giving off light
>     since they
>     > do not interact with external lighting.
>     >
>     > Implementation will consist of simple changes to both 3D rendering
>     > pipelines.
>     >
>     > Please evaluate,
>     > Nir
>     >
>     > [1] https://bugs.openjdk.java.net/browse/JDK-8221720
>



More information about the openjfx-discuss mailing list