SkyShader example, get light color

356 views Asked by At

With Theee.js, I'd like to add a directional light in the SkyShader demo scene

I can get the "sun" position, but I have no clues how to get the sun color to match with the light. Is it possible ? Thank you.

1

There are 1 answers

0
Mugen87 On

Is it possible ?

The sky shader computes the colors for a sky box. As you can see in the example these color values vary according to the fragments world position. And even if the shader would compute the expected color value, there is no easy way to extract it from the shader.

Hence, it's probably best if you manually choose an appropriate color for your directional light.