Sign in to follow this  
lomateron

1D and 3D textures useless?

Recommended Posts

1D textures have a very limited size

 

3D textures don't support a DepthStencilView

and need the geometry shader to render to it.

 

why would this formats exist?

what can be done with 1D or 3D textures that I can't be done in 2D textures?

 

Share this post


Link to post
Share on other sites

knowing that a 3D shaderResourceView are optimized to be faster when reading near pixels...

can I create a 3D shader resource view of a 2D texture?

I need to use a 2D texture because 3D textures don't support a depthStencilView when rendering to them

Edited by lomateron

Share this post


Link to post
Share on other sites

I tried and I can't create a 3D shader resource view of a 2D texture...

 

Anyone here knows how to organize the texels of a 2D texture so it looks exactly the same as a 3D texture in memory?

Example: I want to create a (100,200,300) 3D texture, how will this look in a 2D texture (?,?)

and how a 2D coordinate transform into a 3D coordinate and the other way around

 

I know I can create my own organization, but as I said I want it to be exactly as a 3D texture because maybe it will have the same performance optimizations.

Edited by lomateron

Share this post


Link to post
Share on other sites


I want to create a (100,200,300) 3D texture, how will this look in a 2D texture (?,?)

 

To represent the same number of texels as that 3D texture you would need to create one very larger 2D texture, e.g. 30,000 x 200 - of course it won't look exactly the same in memory and I would think that mipmapping will be very different and probably give undesirable results. Otherwise 300 separate 100x200 2D textures? 

 

Promit's link on texture tiling is probably what you are after here.

Share this post


Link to post
Share on other sites

If you do manual address translation between 3d and 2d, your memory access pattern is effectively more random than if you'd just simply use 2d coordinates to begin with. This would eat any performance benefits, if there were any.

Edited by Nik02

Share this post


Link to post
Share on other sites

I am doing collision physics on the GPU, the particles are in 3D space, but I can't use 3D texture because of the depthstencilview thing

I already have the collision physics working using 2D textures with a cube space 225x225x225 which is easy to transform to 2D 3375x3375

It is bretty 60 fps smooth when all particles move in the same region and in certain ways but things get horrible when they move randomly,

like 1 fps(I am running in an ATI mobility 4530)

I will now use a 2D texture 4096x8192 (power of 2) where each row is a 3D spacecube of 16x16x16, and I will report if it is faster when particles gets random

 

any suggestions?

Edited by lomateron

Share this post


Link to post
Share on other sites

any suggestions?

 

Compute shaders are good for this, along with UAVs and/or append-consume buffers - btw I imagine you would be able to use your 3D texture here. Not sure what feature level you are targeting though.

Edited by spazzarama

Share this post


Link to post
Share on other sites

UPDATE:

just reporting back, the change was successful and now the game runs a little bit slower when balls get random, but I think the massive increase change in texture size (from 225*225*225 to 400*400*200)is related to this too 

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