Rendering Sun & Lens Flare, projection problem
Hello,
I want to do a sun in my terrain engine. Bright objects like a sun or other lightsource have a halo around them. This halo is never clipped, it''s visible or not. And if it''s visible, it''s entirely visible above all other geometrie. See Unreal for an example of such cornas.
The problem is that my sun is part of the skybox. This means it always has a fixed distance to the viewer and is in a different coordinate system than the world. But I need to draw a line from the viewer to the sun to determine its visibility. Yeah, that''s easy. But I don''t know how to calculate the sun position in world space. Any ideas ???
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity
I''d say leave the sun in camera-object space. Since it''s so far away, you''ll never be transforming it in relation to the world (because it would only move 0.000000000001 unit at a time, or some other such nonsense). So, locate the sun as a vector relative to the camera''s position, thus putting the sun in object space around the camera (hence my phrase, camera-object space).
I hope you can figure the rest out.
I hope you can figure the rest out.
GDNet+. It's only $5 a month. You know you want it.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement