[Solved] 2 quick CG questions..

Problems building or running the engine, queries about how to use features etc.
User avatar
Zeal
Ogre Magi
Posts: 1260
Joined: Mon Aug 07, 2006 6:16 am
Location: Colorado Springs, CO USA

[Solved] 2 quick CG questions..

Post by Zeal »

I recently started testing my engine in opengl, and one thing I found was that opengl does not let me do different pixel formats in my MRT. I am not talking about different total bits, just different formats. For example, using the directx rendersystem I AM able to have one 'Ogre::PF_FLOAT32_GR' and one 'Ogre::PF_FLOAT16_RGBA' render target in my MRT. However when using the opengl rendersystem I get the following error...
15:53:29: OGRE EXCEPTION(2:InvalidParametersException): Attachment 2 has incompatible format. in GLFrameBufferObject::initialise at e:\projects\ogrecvs\branches\eihort\ogre\rendersystems\gl\src\ogreglframebufferobject.cpp (line 117)
The error goes away if I use the exact same PF. Is this normal? If so, what makes directx so special (besides bill gates)?

And a second quick question - when switching to opengl I also had a bit of trouble getting the profiles on my cg shaders right. I was under the impression that fp30 was equal to ps_3_0? I wasnt able to get my shader model 3 programs to compile with fp30, I had to use fp40. I guess despite the confusing name, fp30 is NOT equal to ps_3_0?
Last edited by Zeal on Wed Aug 27, 2008 10:24 pm, edited 1 time in total.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67

Post by sinbad »

This is related to the FBO format validation, and I'm afraid GL still lags behind DirectX in some of these fringe areas. It's the same reason DirectX lets you configure buffer access modes quite tightly for performance, but GL is more woolly and hard to get performing well. Blame design by committee, and that GL isn't popular anymore in games so drivers for the higher-end stuff are often not well maintained. It's possible the FBO implementation should allow this combination (although the spec is woolly on what is required to be implemented again) but driver writers just haven't supported it because there's no Crysis equivalent on GL making them implement it. I dispair somewhat at the state of GL these days.

fp30 isn't ps_3_0 no, you should check the specific profiles to see precisely what they can do. They evolved separately.