Are render-target textures special?

Started by
4 comments, last by Zoner 12 years, 4 months ago
Hardware we're targeting is old enough to have issues like requiring power-of-2 texture sizes - integrated Intel chips like GMA950 are the low-end of our range.

For rendering full-screen, you might often want to render to a full-size off-screen buffer using a render-texture. I wondered if this has exactly the same rules as other textures - because rendering the entire scene to a pow2 target is going to be a pain when few resolutions are power of two... you'd get stretching/squashing artifacts.

Is anyone expert in older hardware specs and tips/tricks?

www.simulatedmedicine.com - medical simulation software

Looking to find experienced Ogre & shader developers/artists. PM me or contact through website with a contact email address if interested.

Advertisement
I've used non-power-of-two render target textures on Intels going back to the 910/915 range and they work Just Fine. (What I haven't done is try LockRect'ing the texture and seeing what the Pitch value is; that might be an interesting exercise.)

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

And regular textures did have to obey the pow2 rule on such chips?

Thanks!

www.simulatedmedicine.com - medical simulation software

Looking to find experienced Ogre & shader developers/artists. PM me or contact through website with a contact email address if interested.

I'm not sure about the exact D3D rules, but under OpenGL you can create NPOT textures on these devices, for both texturing and rendering, subject to a bunch of restrictions. The big ones are that such textures cannot be mipmapped, and the only supported wrap mode is Clamp to Edge.
On OS X at least, these textures are supported all the way back to Rage 128. I'd be shocked if that same functionally wasn't also available somehow in D3D.
Restriction-free NPOT textures obviously only appeared on later devices.

And regular textures did have to obey the pow2 rule on such chips?

Thanks!


Yup, that's roundabout it. Of course, the fillrate overhead of using render to texture hurts performance with these chips, but otherwise everything works as expected. My old 915-equipped laptop has gone to the great parts bin in the sky, but I've just tested and confirmed on a 945.


I'm not sure about the exact D3D rules, but under OpenGL you can create NPOT textures on these devices, for both texturing and rendering, subject to a bunch of restrictions. The big ones are that such textures cannot be mipmapped, and the only supported wrap mode is Clamp to Edge.
On OS X at least, these textures are supported all the way back to Rage 128. I'd be shocked if that same functionally wasn't also available somehow in D3D.
Restriction-free NPOT textures obviously only appeared on later devices.


That would be GL_ARB_texture_rectangle; I haven't checked the extension string on an Intel for this but I'd be amazed if Intel exposed it (even if the hardware did support it). Although they do expose GL_ARB_vertex_buffer_object on these parts (and even ARB asm vertex/fragment programs!) so I've been surprised by them before.

The D3D terminology is conditional versus unconditional non-power-of-2 support, and works in broadly the same way.

The restrictions aren't that big a deal with standard render target usage; most commonly you're not going to need mipmaps or repeat wrap modes anyway.

The bear trap here is the GeForce FX series (hopefully you'll never have to come across one of these) which exposed GL_ARB_texture_non_power_of_two (as it was required to in order to claim OpenGL 2.0 support) but dropped you back to full software emulation without warning if you tried to use it (as it was allowed to per the OpenGL spec). Grrrrr. (I never got to test how this part behaved under D3D.)

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Render targets can be pretty much any resolution that the hardware supports, without regard to power of two-ness.

However textures and targets that aren't power of two are likely to use extra memory due being rounded up to some hardware specific tile or pitch requirement, and are harder (impossible? hard to remember) to use UV tiling
http://www.gearboxsoftware.com/

This topic is closed to new replies.

Advertisement