How to transform BoundingShapes to screen space ?

Started by
5 comments, last by Hodgman 9 years, 10 months ago

Hello .

I am trying to implement a tiled deferred shading pipeline . Where I am sticking is to find out what lights affect a given tile ?

I read a paper that said we have to generate AABBs of lights in screen space . So Let's say I have my AABB in World space .

Should I just transform 8 vertices of the box to screen space and recalculate the AABB in screen space ?

And another question how is it possible to transform a sphere bounding shape to screen space ?

Thanks in advance

Advertisement

Sorry to post again. For my first question only a yes or no is enough . No one can help me ?

1) Yes.

2) For the sphere, you may want to calculate its AABB and then goto 1

Yep the typical solution is to project the corners of the original bounding shape, then take their min/max to get a new 2D bounding rectangle.

As mentioned by Giallanon, it's common to convert spheres into cubes and then just use this method.

Another option is that you can project a 3D sphere to a 2D ellipse, shown here: http://www.iquilezles.org/www/articles/sphereproj/sphereproj.htm

Hi,

Firstly, could I ask the OP what paper he is reading? I didn't actually find anything on the tile based deferred system whilst hunting around the internet about a year back and it's something I wish I knew more about (past the BF3 powerpoint presentation)

Secondly, I recently did a "Tile Based Forward Renderer" for my final year project at uni and found the book: GPU Pro 4 to be extreamly handy (2 chapters on the system, one from the guys at AMD). Theres also some very useful source code on the AMD website (they call it Forward+).

My system (and the AMD system) did these light (bounding spheres) to tile intersection tests in view space.

Thanks every one .

Dbowler92 , if u have done tiled forward shading so the deferred one would't be a big deal to you.

1) Generate G-buffer as usual

2) Split the screen into some tiles (for example 32*32 tiles in pixel)

3) Assig every tile the lights that has an effect on it .

4) either draw a fulscreen quad or in compute shader . Foreach tile iterate through all lights assigned to it and perform the lighting using the G-buffer .

You may find this helpful : https://software.intel.com/en-us/articles/deferred-rendering-for-current-and-future-rendering-pipelines

This might also be handy:

http://www.humus.name/Articles/PracticalClusteredShading.pdf

This topic is closed to new replies.

Advertisement