I really want to add an effect like this to our 3D Engine:
This is the so-called Mental Ray "Camera Glow Shader". We want it to apply such effects to some objects we have in the level. Any idea/guideline about implement this?
code is for OpenGL and I'm working on Directx. Basically my adaptation is:
Compute light pos in camera space and then negate Z component
Compute aspect ratio = (screenW/screenH)
Compute e (focal lenght) as 1/tan(FOV/2)
Invoke Project_Sphere function
Set scissor rect based on top function results (scaling them from [-1,1] to screen coords
results are ok If I'm "inside" the light volume or light is not visible: problem arises when intersection are computed. Basically the returned rect is very small compared to results I'm expecting....any advice?
I'm trying to reuse the g-buffer for computing a "shadows mask or buffer"; basically after computing the appropriate Shadows Map for a light (point,directional or spot) I just want to reuse g-buffer stored position for performing shadows check for shadows receiving geometry.
Now comes a little problem: If I just store world or view space position (viewpos.x,viewpos.y,viewpos.z) in the g-buffer everything is fine
If I try to store just view space lenght and reconstruct position (just to save memory bandwidth), on shadows check I just got some artifacts almoust just on "caster" geometry and when the camera comes close to them (look at red circle):
To solve the problem I've raise SHADOWS_EPSILON (or BIAS) value but this lead to other problems...so I'm wondering if someone can point me out where the problem can be.....it's just a numerical imprecision problem?
Any advice appreciated
Thanks Mauro
p.s. I've been using this reconstruction for deferred lighting in the past months without noticeable artifacts....but probably Shadows artifacts are more sensitive to numerical errors
Since now we've used MFC for the development of our game editor.
Basically the Tool is linked with our graphics library (a WIN32 static library that cares about 3d rendering mostly).
I'm wondering if switching to .NEt or WPF could give us a major benefit in terms of productivity.
Creating properties window, forms and other object with MFC is time consuming so we're searching for better solutions. Also we're gonna need to create timeline form to control animation and similar controls.