mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024872: Support of emission color in Phong shader and ray-tracing
Test cases for issue CR24872
This commit is contained in:
@@ -165,9 +165,11 @@ vec4 computeLighting (in vec3 theNormal,
|
||||
vec4 aMaterialAmbient = gl_FrontFacing ? occFrontMaterial_Ambient() : occBackMaterial_Ambient();
|
||||
vec4 aMaterialDiffuse = gl_FrontFacing ? occFrontMaterial_Diffuse() : occBackMaterial_Diffuse();
|
||||
vec4 aMaterialSpecular = gl_FrontFacing ? occFrontMaterial_Specular() : occBackMaterial_Specular();
|
||||
vec4 aMaterialEmission = gl_FrontFacing ? occFrontMaterial_Emission() : occBackMaterial_Emission();
|
||||
return vec4 (Ambient, 1.0) * aMaterialAmbient
|
||||
+ vec4 (Diffuse, 1.0) * aMaterialDiffuse
|
||||
+ vec4 (Specular, 1.0) * aMaterialSpecular;
|
||||
+ vec4 (Specular, 1.0) * aMaterialSpecular
|
||||
+ aMaterialEmission;
|
||||
}
|
||||
|
||||
//! Entry point to the Fragment Shader
|
||||
|
@@ -916,7 +916,9 @@ vec4 Radiance (in SRay theRay, in vec3 theInverse)
|
||||
uRaytraceMaterialTexture, MATERIAL_SPEC (aTriIndex.w));
|
||||
vec4 aOpacity = texelFetch (
|
||||
uRaytraceMaterialTexture, MATERIAL_TRAN (aTriIndex.w));
|
||||
|
||||
vec3 aEmission = texelFetch (
|
||||
uRaytraceMaterialTexture, MATERIAL_EMIS (aTriIndex.w)).rgb;
|
||||
|
||||
vec3 aNormal = SmoothNormal (aHit.UV, aTriIndex);
|
||||
|
||||
vec4 aInvTransf0 = texelFetch (uSceneTransformTexture, anObjectId * 4 + 0);
|
||||
@@ -980,6 +982,8 @@ vec4 Radiance (in SRay theRay, in vec3 theInverse)
|
||||
|
||||
aResult.xyz += aWeight.xyz * uGlobalAmbient.xyz *
|
||||
aAmbient * aOpacity.x * max (abs (dot (aNormal, theRay.Direct)), 0.5f);
|
||||
|
||||
aResult.xyz += aWeight.xyz * aOpacity.x * aEmission;
|
||||
|
||||
if (aOpacity.x != 1.0f)
|
||||
{
|
||||
|
Reference in New Issue
Block a user