Re: Re: Tips for debugging D3D Textures & DirectSound?
Gavriel State <[email protected]> Wed, 13 Oct 2004 16:45:11 -0400
| Newsgroups | gmane.comp.emulators.winex.devel |
|---|---|
| Message-ID | <[email protected]> |
Ove Kaaven wrote: >>The if block was setting gl's error # (returned via glGetError) to 0x0502 >>(GL_INVALID_OPERATION). I was working off the assumption that this was >>causing some textures to fail to load (got most of them loading, just the >>loading screens to go and a rendering glitch in the unit-painter where a >>texture is rendered WAY oversize). >> >> > >Sounds like you may have made some wrong assumptions, leading you to >believe getting NPOT working would actually be easy. If it was, we would >have done it ourselves long ago. Getting the textures loaded and used is >easy if you know how (though it's not clear that you do), getting them >rendered properly is the hard part. > > Just to be clear, the hard part with NPOT texturing is the fact that with the currently available GL extensions, the texture coordinates need to be sent to GL in the range of (0..width, 0..height), instead of the (0..1, 0..1) we are given by the application using D3D. This means that in order to support these textures without the upcoming GL 2.0 extensions, we would need to have a duplicate texture coordinate buffer with the coordinates in the (0..width, 0..height) form, and fill it from the (0..1, 0..1) source data. We already have to do similar things when we have pretransformed position coordinates, and with vertex color data, and there are some very complex optimizations at the x11drv/executebuffer level to ensure that they can work with acceptable performance. Rectangular textures are actually probably not such a big deal in terms of performance, since they mostly seem to be used with very basic rendering. So it might be possible to disable the executebuffer code path when trying to render when one of the textures is NPOT, and avoid the added complication of dealing with that side of the code. But it's certainly not going to be a simple thing to do, in any case. Take care, -Gav -- Gavriel State Co-CEO & CTO TransGaming Technologies Inc. [email protected] http://www.transgaming.com Let the games begin!