Usage Texture3D with VolumetricData

Started by
5 comments, last by SuperVGA 13 years, 5 months ago
Hi
i am new to XNA(4.0) and C#. I've got to solve to following problem:
i've got an dataset, from which i can create a Texture3D (its a set of volumetric data, a box and within this box there is a volume with value != 0, i have to map these values to colors, while 0 == Color.Transparent).

The Problem is i don't know how to use these Texture3D i created from the data.

I created a bounding box, but i really have no clue how to put the Texture3D on it.

http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphics.texture3d.aspx
So do i have to use a RenderTargetCube? This is just one Set, so no MipMap Levels? I only found examples for RenderTarget2D.

Or is this done in the Effect file?

This is my Effect1.fx:
http://csharp.pastebin.com/P71aVypk

And the DefaultEffect.cs:
http://csharp.pastebin.com/uFPxezAc

And the BoundingBox.cs:
http://csharp.pastebin.com/0dKc2Szk

Any Tips or Hints in which direction i should go?

Advertisement
You should run a pixel shader on it, traversing through the bounding box while sampling the Texture3D.
AFAIK there's no fixed functionality to render a 3D texture as a volume.
(But sure, you can apply the texture to polygons, only I think you'd better stick with the pixel shader raycaster)
I need it raycastet at the end, but i don't know how to do this. :(

Quote:Original post by wishes
I need it raycastet at the end, but i don't know how to do this. :(
Then you should be prepared to learn. In this case, as in most others, Google is your friend

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Well, i am trying to, but at the moment i am quite overwhelmed. The problem is also that at dont really unterstand the explanation of the Texture3D in the Library Reference,in my understanding i can use a normal 2dtexture sampler, and the slices getting rendered with RenderTargetCubes... but i dont understand how to bound those RenderTargetCubes.... an all examples are for Environmentmapping, Skydomes ...
Did you click the link I provided? It is an exact tutorial of volume texture ray casting in XNA...

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Quote:Original post by swiftcoder
Did you click the link I provided? It is an exact tutorial of volume texture ray casting in XNA...
I'm not sure why that link won't work here, a little less perma here:
Older posts...
As Tristam points out, a tiny little bit of googlin' should do the job of getting some good papers.

And, I know you're using DX but these cover the topic well also:

Peter Triers blog
John Pawasauskas' old theory

Its basics are trivial, you should've implemented in no time after a little understanding. Its optimizations are not. :/

[Edited by - SuperVGA on November 10, 2010 12:09:16 PM]

This topic is closed to new replies.

Advertisement