Page 1 of 1

texture unit luminance

Posted: Mon Aug 04, 2025 6:10 pm
by jordiperezarti

Code: Select all

                texture_unit
		{
		    texture floor.jpg
		}

		texture_unit
		{
		    texture floor_luminance.jpg
		    colour_op_ex modulate_x2 src_current src_texture
                }

In the second texture unit, is possible to obtain the luminance from the floor.jpg texture?
now i am adding the second texure file floor_luminance.jpg, but is possible to obtain this luminance from script?


Re: texture unit luminance

Posted: Thu Aug 07, 2025 2:42 pm
by rpgplayerrobin

Yes, in hlsl it looks like this to convert from an RGB texture to a luminance value:

float3 albedo = tex2D(AlbedoMap, uv).xyz;
float luminance = pow(dot(albedo, float3(0.2126, 0.7152, 0.0722)), 1); // Change the "1" to any value to control the luminance


Re: texture unit luminance

Posted: Fri Aug 08, 2025 4:28 pm
by jordiperezarti

this is going down to the shader code, but is possible to got it from the material script?