Skip to content

Commit

Permalink
Update Billiard_Table_Fragment.glsl
Browse files Browse the repository at this point in the history
  • Loading branch information
erichlof authored Oct 27, 2023
1 parent 68b0078 commit 6a61416
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions shaders/Billiard_Table_Fragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ vec3 CalculateRadiance( out vec3 objectNormal, out vec3 objectColor, out float o
vec3 tdir;
vec3 dirToLight;
vec3 x, n, nl;
vec3 textureColor;

float t;
float weight;
Expand Down Expand Up @@ -285,8 +286,10 @@ vec3 CalculateRadiance( out vec3 objectNormal, out vec3 objectColor, out float o
{

if (hitType == CLOTH)
hitColor *= pow(clamp(texture(tClothTexture, (10.0 * x.xz) / 512.0).rgb, 0.0, 1.0), vec3(2.2));

{
textureColor = texture(tClothTexture, (10.0 * x.xz) / 512.0).rgb;
hitColor *= (textureColor * textureColor);
}
if (bounces == 0)
objectColor = hitColor;

Expand Down Expand Up @@ -408,14 +411,20 @@ vec3 CalculateRadiance( out vec3 objectNormal, out vec3 objectColor, out float o
isSpot = TRUE;

if (hitType == DARKWOOD)
hitColor *= pow(clamp(texture(tDarkWoodTexture, 3.5 * x.xz / 512.0).rgb, 0.0, 1.0), vec3(2.2));
{
textureColor = texture(tDarkWoodTexture, 3.5 * x.xz / 512.0).rgb;
hitColor *= (textureColor * textureColor);
}

if (isSpot == TRUE)
hitColor = clamp(hitColor + 0.5, 0.0, 1.0);

if (hitType == LIGHTWOOD)
hitColor *= pow(clamp(texture(tLightWoodTexture, 6.0 * x.xz / 512.0).rgb, 0.0, 1.0), vec3(2.2));


if (hitType == LIGHTWOOD)
{
textureColor = texture(tLightWoodTexture, 6.0 * x.xz / 512.0).rgb;
hitColor *= (textureColor * textureColor);
}

if (bounces == 0)
objectColor = hitColor;

Expand Down

0 comments on commit 6a61416

Please sign in to comment.