71M

Hi,

Is there a fast way to update the textures of a cube map

Currently I'm rendering out the six directions and calling TextureCube.SetData to copy the render target contents across. This isn't particularly nice but I haven't found any other way to over come this. The only other alternative I can think of is to completely scrap using TextureCubes and use a list of bog standard Texture2Ds and a 'fancy' shader.

Cheers,

Tim



Re: XNA Framework Dynamic CubeMap, How?

The ZMan

Not that *I* know of. There were some good DX10 demos at GDC last year where they showed DX10 features rendering into the 6 faces at the same time.

I think most games though don't rerender the cube map every frame. Often they are blurred, low rez images and if things are moving slowly enough you can't tell that the reflections or lighitng maps is slightly wrong. So try only rendering one face every 2-3 frames.






Re: XNA Framework Dynamic CubeMap, How?

71M

Ok, thanks for the suggestion, I'll try rendering a side each frame, seems to be a natural way to go.

Cheers,

71M





Re: XNA Framework Dynamic CubeMap, How?

The ZMan

You might read this thread too where Shawn talks about rotating through render targets to not block the GPU.




Re: XNA Framework Dynamic CubeMap, How?

Shawn Hargreaves - MSFT

SetData involves copying everything via the CPU, which is bad and slow.

The fast way to do this is using a RenderTargetCube, which was created exactly for the scenario you are describing. You still have to render six times for each face, but you can do this directly to the cubemap, no need for copying data around.





Re: XNA Framework Dynamic CubeMap, How?

noNchaoTic

Also you may wish to consider dual paraboloid mapping to reduce the number of renders, it doesn't however make the projection math a little hairy :-/




Re: XNA Framework Dynamic CubeMap, How?

BrianOsman

Yeah. What's your application Shadowmaps for point lights Environment maps Some other lighting use Lots of conventional wisdom says that dual-paraboloid mapping is impractical, but I beg to differ (depending on your requirements, including the particular rendering use, and also things like your camera and geometry.)

http://delivery.acm.org/10.1145/1190000/1183331/p103-osman.pdf key1=1183331&key2=2301582711&coll=portal&dl=ACM&CFID=15151515&CFTOKEN=6184618