Copy texture (render target) to volume slice
Started by starstutter, Mar 09 2009 03:02 AM
11 replies to this topic
#1
Posted 09 March 2009 - 03:02 AM
Hi, I have been googling a simple question that so far doesn't really appear to have an answer (well a straight forward one anyway), and part of the problem is that I need specific commands.
Is there a way to render just a normal scene to a regular 2D render target, than take that render target and copy it to a "slice" of a volumetric texture in directX 9? If so, what are the steps to follow. I need the functions specificly, since volume textures seem to make no reference to regular 2D surfaces, such as GetSurfaceLevel().
Also, locking the volume texture itself and transfering pixel-by-pixel is not an option I'm afraid. The target framerate for this is about 40 fps, anything less would be unacceptable.
Thanks in advance.
EDIT: also, I don't think this is possible, but are you able to take a slice of a volume texture and directly make it a render target? I know there's a way to in DX10, but I'm not using that.
Is there a way to render just a normal scene to a regular 2D render target, than take that render target and copy it to a "slice" of a volumetric texture in directX 9? If so, what are the steps to follow. I need the functions specificly, since volume textures seem to make no reference to regular 2D surfaces, such as GetSurfaceLevel().
Also, locking the volume texture itself and transfering pixel-by-pixel is not an option I'm afraid. The target framerate for this is about 40 fps, anything less would be unacceptable.
Thanks in advance.
EDIT: also, I don't think this is possible, but are you able to take a slice of a volume texture and directly make it a render target? I know there's a way to in DX10, but I'm not using that.
(\__/)
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!
#2
Posted 09 March 2009 - 07:22 PM
I tried to make a deep research in documentation, but i did not found nothing that can help you.
You should try asking at official XNA forum.
You should try asking at official XNA forum.
#3
Posted 09 March 2009 - 07:29 PM
TBH I had a look at it too and I just couldn't see any way to do it as you require. Would be easy using a Texture Array under DX10 ... but thats not much help, alas :(
#4
Posted 09 March 2009 - 09:22 PM
**sigh**
Well, thanks anyway guys
Well, thanks anyway guys
(\__/)
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!
#5
Posted 10 March 2009 - 02:33 PM
Does it have to be a volume texture? Couldn't you use a series of 2D textures instead?
"Stupid bug! You go squish now!!" - Homer Simpson
#6
Posted 10 March 2009 - 05:38 PM
could you expand on that? My target resolution is 64x64x64. Are you suggesting I have an array of 64 textures? I guess that would be fine for resource management but how on earth would I make use of that in the shader? There are no shader-based texture arrays in DX 9 of course.
Thanks for any advice.
EDIT: wait, I just got an idea and maybe this is what you were saying. I could place the 64 (64x64) slices on a single 512x512 texture! Each one coule be treated like its own texture using rect bounds and careful control of UV coordinates.
:D
This just might work! Thank you so much! (whether you meant to say that or not :) )
Thanks for any advice.
EDIT: wait, I just got an idea and maybe this is what you were saying. I could place the 64 (64x64) slices on a single 512x512 texture! Each one coule be treated like its own texture using rect bounds and careful control of UV coordinates.
:D
This just might work! Thank you so much! (whether you meant to say that or not :) )
(\__/)
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!
#7
Posted 10 March 2009 - 06:45 PM
Even easier to use a 4096x64 texture, if your card lets you use dimensions that large. Also, you of course won't get any filtering along the texture 'z' axis this way, unless you do it yourself, but I assume you already considered that.
reedbeta.com - developer blog, OpenGL demos, and other projects
#8
Posted 10 March 2009 - 07:26 PM
Reedbeta said:
Even easier to use a 4096x64 texture, if your card lets you use dimensions that large.
Quote
Also, you of course won't get any filtering along the texture 'z' axis this way, unless you do it yourself, but I assume you already considered that. :)
(\__/)
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!
#9
Posted 10 March 2009 - 08:04 PM
Yeah that was what I meant, glad to see you pieced it together from my sparse comment :)
I don't now if POW2 textures are faster anymore (and I couldn't care less about 'good practice'), but managing the UV coordinates are simpler when using a 4096x64 texture.
Either way, good luck
I don't now if POW2 textures are faster anymore (and I couldn't care less about 'good practice'), but managing the UV coordinates are simpler when using a 4096x64 texture.
Either way, good luck
"Stupid bug! You go squish now!!" - Homer Simpson
#10
Posted 10 March 2009 - 08:35 PM
starstutter said:
yup, it does, but I perfer to keep the dimentions even and powers of 2 whenever possible
4096 and 64 are powers of two.
reedbeta.com - developer blog, OpenGL demos, and other projects
#11
Posted 10 March 2009 - 08:39 PM
Beaware of filtering issues in the horizontal edges of the images if you go with 4096x64 texture and that it doesn't tile horizontally like volume textures either. Might not be an issue in your case though.
#12
Posted 10 March 2009 - 10:33 PM
Reedbeta said:
4096 and 64 are powers of two. ;) I don't think there's any speedup involved with using a square texture over a rectangular one, though.
JarkkoL said:
Beaware of filtering issues in the horizontal edges of the images if you go with 4096x64 texture and that it doesn't tile horizontally like volume textures either. Might not be an issue in your case though.
(\__/)
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












