Sign in to follow this  
martinperry

Ray-Casted model in polygonal scene

Recommended Posts

martinperry    102
I have classic polygonal scene (terrain, buildings etc.). Now I want to render volumetric model into this scene, using ray-casting. And I am not quite sure, how to do this... my only idea is to render polygonal scene to texture (same approach as for deferred rendering), than use depth map in ray-cast renderer and render ray-casted image to deffered scene.

Is there any other way ? With deferred rendering I have problem with aliasing and it has also little performance impact.

Share this post


Link to post
Share on other sites
Digitalfragment    1504
[quote name='martinperry' timestamp='1314009526' post='4852215']
I have classic polygonal scene (terrain, buildings etc.). Now I want to render volumetric model into this scene, using ray-casting. And I am not quite sure, how to do this... my only idea is to render polygonal scene to texture (same approach as for deferred rendering), than use depth map in ray-cast renderer and render ray-casted image to deffered scene.

Is there any other way ? With deferred rendering I have problem with aliasing and it has also little performance impact.
[/quote]

Sounds like you're after a hybrid of poly rasterization and voxel rendering.
If your volumetric data is in a 3D texture, you could ray trace it in a pixel shader, or another option is to use isosurface extraction techniques to generate a polygonal surface from the volumetric data (like the Marching Cubes algorithm)

Share this post


Link to post
Share on other sites
martinperry    102
[quote]Sounds like you're after a hybrid of poly rasterization and voxel rendering. [/quote]

Yeah... thats what I am looking for.

Extraction (Marching Cubes etc) is not suitable, because of large amount of triangles... if i have model of 1024x1024x1024.. thats really huge. For ray-casting I can use GPU, but extracting is more complicated on GPU in real-time (dynamic number of triangles, limited VB size etc)

Share this post


Link to post
Share on other sites
Hodgman    51337
[quote name='martinperry' timestamp='1314009526' post='4852215']my only idea is to render polygonal scene to texture, then use depth map in ray-cast renderer and render ray-casted image to deffered scene.[/quote]You can render your scene as normal, as long as your "ray-cast" pixel shader outputs a depth value. The order that you draw polygonal and ray-cast objects won't matter ([i]as long as you're outputting correct depth values[/i]) as the Z-buffer will continue to function as normal, allowing them both to occlude and intersect each other.

Share this post


Link to post
Share on other sites
Digitalfragment    1504
[quote name='martinperry' timestamp='1314083975' post='4852680']
[quote]Sounds like you're after a hybrid of poly rasterization and voxel rendering. [/quote]

Yeah... thats what I am looking for.

Extraction (Marching Cubes etc) is not suitable, because of large amount of triangles... if i have model of 1024x1024x1024.. thats really huge. For ray-casting I can use GPU, but extracting is more complicated on GPU in real-time (dynamic number of triangles, limited VB size etc)
[/quote]

Isosurface extraction is a pretty widely researched topic, in many flavours each with its own performance/quality trade-offs. Marching Cubes is just the one name I remember the quickest on the matter ;)
http://swiftcoder.wordpress.com/planets/isosurface-extraction/

Share this post


Link to post
Share on other sites
martinperry    102
[quote name='Hodgman' timestamp='1314084186' post='4852682']
[quote name='martinperry' timestamp='1314009526' post='4852215']my only idea is to render polygonal scene to texture, then use depth map in ray-cast renderer and render ray-casted image to deffered scene.[/quote]You can render your scene as normal, as long as your "ray-cast" pixel shader outputs a depth value. The order that you draw polygonal and ray-cast objects won't matter ([i]as long as you're outputting correct depth values[/i]) as the Z-buffer will continue to function as normal, allowing them both to occlude and intersect each other.
[/quote]

Yes.. thats good idea, but problem is, that my ray-caster is in CUDA :(

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this