Color gradient ramp for glowing parts of the mesh
This commit is contained in:
parent
cb5bd093ec
commit
e74e37cc16
11 changed files with 64 additions and 24 deletions
|
|
@ -3,10 +3,13 @@
|
|||
#extension GL_ARB_separate_shader_objects : enable
|
||||
#extension GL_ARB_shading_language_420pack : enable
|
||||
|
||||
layout (binding = 1) uniform sampler2D samplerGradientRamp;
|
||||
|
||||
layout (location = 0) in vec3 inNormal;
|
||||
layout (location = 1) in vec3 inColor;
|
||||
layout (location = 2) in vec3 inEyePos;
|
||||
layout (location = 3) in vec3 inLightVec;
|
||||
layout (location = 4) in vec2 inUV;
|
||||
|
||||
layout (location = 0) out vec4 outFragColor;
|
||||
|
||||
|
|
@ -17,7 +20,7 @@ void main()
|
|||
// to detect bright glow emitters
|
||||
if ((inColor.r >= 0.9) || (inColor.g >= 0.9) || (inColor.b >= 0.9))
|
||||
{
|
||||
outFragColor.rgb = inColor;
|
||||
outFragColor.rgb = texture(samplerGradientRamp, inUV).rgb;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue