Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm working on a radiosity processor. I'm projecting scene geometry onto a hemisphere at a high order of tessellation during a visibility pass onto a 1024x1024 render target. The problem is that the edges of certain triangles are not being rendered to the item buffer( render target )...so when I test certain edges( or pixels during pixel shader ) for visibility during a reconstruction pass, visible edges are not identified and as a result the pixel for that edge is discarded.

One solution was to increase the resolution of the item buffer( up to 4096x4096 )...this helped and more edges were visible, however, this was not fullproof.

How do I increase visibility?

Here is a screenshot of a scene after radiosity is applied: the seams are edges along a triangle face that were not visible due to the resolution of the item buffer... Screenshot of a scene rendered w/radiosity

fixed the problem by sampling the item buffer w/8 points: Screenshot of radiosity scene

code to convert world space position into normalized device coordinates for uv lookup of item buffer:

// position lookup for item buffer
    Output.Pos3 = mul( Input.Position, mWV ); 
// projection is handled by normalizing the viewspace position( as i'm rendering to a hemisphere )
    Output.Pos3.xyz = normalize( Output.Pos3.xyz );

// convert to normalized device coordinates( [ -1, 1 ], [ -1, 1 ] -> [ 0, 1 ], [ 0, 1 ] )
    Output.Pos3.xy *= float2( 0.5, -0.5 );
    Output.Pos3.xy += float2( 0.5, 0.5 );
share|improve this question
2  
why do you need doubles in the first place? doubles perform poorly even on newer hardware.. and unless you are implementing an advanced geometric algorithm I see no reason to use them. maybe you can clarify ? –  concept3d Oct 31 '13 at 20:08
    
i'm implementing a radiosity processor...the visibility pass renders a 32bit address to an item buffer. I need to then render objects to the scene and sample the item buffer using the object's position( in normalized device coordinates ) in order to determine visibility. The problem is that I'm getting false positives because the position values sent to the pixel shader during rasterization are too close. –  P. Avery Oct 31 '13 at 20:17
1  
am not particularly sure that increasing the precision will solve the problem (maybe temporarly or for specific set).. but maybe you need to check where in the code you are losing precision ? maybe ins some sqrt calculations? or maybe your scene scale is just too small or too large.. –  concept3d Oct 31 '13 at 20:37
2  
@P.Avery The hardware isn't going to interpolate double-precision values from the vertex to the pixel properly anyway, so I don't think this approach can work for what you want to do. Anyway, floats have precision of 1 in 2^24, so unless your scene is as big as a small country, I doubt float precision is really your problem. –  Nathan Reed Oct 31 '13 at 20:43
2  
@P.Avery How are you testing visibility? The pixel positions in your hemispherical buffer are obviously not going to match exactly the positions you sample when drawing the eye view. So your test needs to have tolerance for some error in the position. –  Nathan Reed Nov 1 '13 at 1:33
show 9 more comments

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.