Three.js: webgl_postprocessing_godrays example - "sun" jumps & flips "downwards"!

Created on 21 Jan 2020  路  5Comments  路  Source: mrdoob/three.js

In the webgl_postprocessing_godrays.html example
I've put in an OrbitControl ..

Under some view angles the position of the "sun" jumps & flips "downwards"!
(see image)

sun_flipped

The sun, instead of standing "above" the grid, and raying shadows "downwards",
it throws its rays "upwards" ..

Maybe you've like to have a look at:

https://wolfgangvonludwigsburg.github.io/three.js/examples/webgl_postprocessing_godrays.html

I love 3js,
Thank you!

Bug Examples

All 5 comments

Um, this can also be reproduced in the official example without modifications. You just have to move the camera as far as possible to the top or sides.

It seems the jump happens because the signs of the sun's screen space position vector components change.

Hi Michael,

thx for your fast reply!

I've built in a "Matrix display" showing the camera matrix.elements,
you've like to have a look at, here:

https://wolfgangvonludwigsburg.github.io/three.js/examples/webgl_postprocessing_godrays_2.html

Maybe you experts just "see" immediately looking at the matrix, what' going wrong .. ;-)

@wolfgangvonludwigsburg like @Mugen87 says, it is probably when screenSpacePosition.copy( sunPosition ).project( camera ); fails due to the sun going behind the camera. there needs to be a flag passed to the shader that this is the situation.

here: it looks kinda weird when you fix it...
Screen Shot 2020-03-06 at 23 04 47
Screen Shot 2020-03-06 at 23 05 03

It is the thing IRL, too:

oh wow, github has bugs too:
Screen Shot 2020-03-06 at 23 11 05

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Horray picture Horray  路  3Comments

konijn picture konijn  路  3Comments

jlaquinte picture jlaquinte  路  3Comments

zsitro picture zsitro  路  3Comments

jack-jun picture jack-jun  路  3Comments