+ | Texture parse

This commit is contained in:
TheRedShip
2025-01-27 16:59:06 +01:00
parent d93a7342a1
commit 1e0ff2d88d
9 changed files with 38 additions and 7 deletions

View File

@ -105,12 +105,12 @@ uniform sampler2D sphereTexture;
void calculateLightColor(GPUMaterial mat, hitInfo hit, inout vec3 color, inout vec3 light, inout uint rng_state)
{
// if (objects[hit.obj_index].type == 0)
// {
// vec2 uv = getSphereUV(hit.normal);
// color *= texture(sphereTexture, uv).rgb;
// }
// else
if (objects[hit.obj_index].type == 0)
{
vec2 uv = getSphereUV(hit.normal);
color *= texture(sphereTexture, uv).rgb;
}
else
color *= mat.color;
light += mat.emission * mat.color;
// light += sampleLights(hit.position, rng_state);