PDA

View Full Version : ARB_fragment_program equivalent ATI_fragment_shader



ScottManDeath
01-16-2003, 12:33 AM
Hi

I'm playing a little bit with dependent texture reads using different extensions. My goal is it to do a full scene color lookup using a 3D texture and dependent texture reads. At first I render my scene as usually and then I copy it into a texture rectangle. After that I do the dependent read with into the 3D lookup texture.
So far I have implemented it using NV_texture_shader3 and ARB_fragment_program. I would like to do it also using ATI_fragment_shader but I have no chance to test it. Perhaps someone can tell me the outline of the corresponding gl calls.?

Here is the fp:




!!ARBfp1.0
TEMP rgbcol;
TEX rgbcol,fragment.texcoord[0],texture[0], RECT;
TEX result.color, rgbcol,texture[1],3D;
END


Thanks in advance

Bye
ScottManDeath

Ysaneya
01-16-2003, 07:14 AM
From the top of my head:




glSampleMapATI(GL_REG_0_ATI, GL_TEXTURE0_ARB, GL_SWIZZLE_STR_ATI);
glColorFragmentOp1ATI(GL_MOV_ATI, GL_REG_1_ATI, GL_NONE, GL_NONE, GL_REG_0_ATI, GL_NONE, GL_NONE);
glSampleMapATI(GL_REG_1_ATI, GL_REG_1_ATI, GL_SWIZZLE_STR_ATI);
glColorFragmentOp1ATI(GL_MOV_ATI, GL_REG_0_ATI, GL_NONE, GL_NONE, GL_REG_1_ATI, GL_NONE, GL_NONE);


The inner move is needed because you can only do dependant texture reads in the second phase of the shader, and you need at least one instruction between the phases.

After the texture read, the color sampled from the 3D texture is in reg1, it has to be copied to the output register (also reg0).

If it doesn't work, it maybe needs STQ as the dependant read swizzle, just a guess..

Y.

tellaman
01-16-2003, 07:51 AM
wow, could you please provide me with your header files for arb_frag_prog?
here's my email address: tellaman@hotmail.com
thanks

ScottManDeath
01-16-2003, 08:44 AM
Hi

@Ysaneya: thanks http://www.opengl.org/discussion_boards/ubb/smile.gif , tomorrow I'll get access to a Radeon 9700, so I'll test it.

@tellaman: do you mean the headers with tokens and functions ? You can find them on http://www.oss.sgi.com/projects/ogl-sample/

If you mean my loading and setup code, surely, no problem.

Bye
ScottManDeath

tellaman
01-16-2003, 03:06 PM
yes please scott i would need both gl headers (since i still cant seem to find the rite one) and if possible your setup code
thanks in advance http://www.opengl.org/discussion_boards/ubb/smile.gif

ScottManDeath
01-17-2003, 01:38 AM
Hi

I use the GLEW library for an easy way to load extensions: It can be found here: http://glew.sourceforge.net/

The original extension headers are here:
http://oss.sgi.com/projects/ogl-sample/ABI/glext.h
http://oss.sgi.com/projects/ogl-sample/ABI/glxext.h
http://oss.sgi.com/projects/ogl-sample/ABI/wglext.h

Bye
ScottManDeath

tellaman
01-17-2003, 04:34 AM
hi scott and thanks for your reply
unfortunately i'm still having problems
i hope you can help me out

i've just dloaded glew and run glewinfo:
GL_ARB_fragment_program: MISSING

i'm running on a geforce4 ti4600, 41.09 drivers
is there anything i could do about it?

and more than this i've looked into the headers you were linking to and couldnt find nothing about some sort of GL_ARB_fragment_program tokens, only fragment_shader_ati can be found

any ideas to fix this?

as usual, thanks a lot

ScottManDeath
01-17-2003, 05:54 AM
Hi

you need Detonator 42.01 beta http://www.guru3d.com and the nvidia emulation tool http://developer.nvidia.com/docs/IO/3260/ATT/NVEmulate.exe (or a GeforceFX http://www.opengl.org/discussion_boards/ubb/biggrin.gif )

The glext headers don't include the new extensions http://www.opengl.org/discussion_boards/ubb/frown.gif but glew has those in. Just call init glew, activate emualation and the show goes on...

Bye
ScottManDeath



[This message has been edited by ScottManDeath (edited 01-17-2003).]

tellaman
01-17-2003, 06:08 AM
lol! sounds like glew is doing some magic!
thanks a bunch this should definitely fix my prob!