GodRays on Objects

Materials, textures, lighting, postfx
5 posts Page 1 of 1
OscarVelzi
Posts: 3
Joined: Sun Jul 05, 2015 6:50 pm
by OscarVelzi » Sun Jul 05, 2015 6:51 pm
Is it possible to cast godrays from an object other than the sun?

Thanks!
Chelaru
Posts: 188
Joined: Wed Jul 01, 2015 10:33 am
by Chelaru » Mon Jul 06, 2015 12:36 pm
Yes. You must write the shader for that.
buckmaster
Steering Committee
Steering Committee
Posts: 321
Joined: Thu Feb 05, 2015 1:02 am
by buckmaster » Mon Jul 06, 2015 1:42 pm
screenSunPos seems to have something to do with it!
Chelaru
Posts: 188
Joined: Wed Jul 01, 2015 10:33 am
by Chelaru » Tue Jul 07, 2015 9:11 am
You need the position of the light source. The current shader uses the sun position and calculates an occlusion mask, to see what is blocking the sun from the player perspectiv.

To achieve this effect you would need the position of every light source that is visible to the player, and create the occlusion mask for it. Then you could do radial filter on every vector (light - player), add the mask to the current buffer. And you should have the effect.
OscarVelzi
Posts: 3
Joined: Sun Jul 05, 2015 6:50 pm
by OscarVelzi » Tue Jul 07, 2015 1:41 pm
Thanks for the reply!
5 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest