Problem with CubeMapping And ARB_fragment_program

Started by
5 comments, last by silvermace 19 years, 6 months ago
Hello! I am trying to implement Simple Cube Mapping with ARB_fragment_program. But i Fail. My code is this: !!ARBfp1.0 OUTPUT output = result.color; TEMP base; TEX base, fragment.texcoord[0], texture[0], CUBE; MOV output, base; END i guess its wrong. Any idea what i must do to make it work? thanks!
Advertisement
provide more details on the error please, does it fail to compiler, does it run incorrectly, have you got a vertex program etc. etc.
"I am a donut! Ask not how many tris/batch, but rather how many batches/frame!" -- Matthias Wloka & Richard Huddy, (GDC, DirectX 9 Performance)

http://www.silvermace.com/ -- My personal website
well... when i enable the shader i can't see the object i render with the shader.
I know that the shader is not correct cause i dont know how to use Cube maps in ARB_fragment_program. I also dont have a ARB_vertex_program.
I can not find any example on the internet.
there must be a ARB_fragment_program cubemap example in this planet... but i can't find it! :P
hm, try this, force the fragment output to be white, ie do nothing in the fragment program, just set result.color to white, if the screen goes white, we know there's something wrong with your FP code, if not, its prolly your setup.
"I am a donut! Ask not how many tris/batch, but rather how many batches/frame!" -- Matthias Wloka & Richard Huddy, (GDC, DirectX 9 Performance)

http://www.silvermace.com/ -- My personal website
yeah.. you are right..
My code was massy and i had an mistake a the shader setup.
Now it works with this:

!!ARBfp1.0
TEX result.color, fragment.texcoord[0], texture[0], CUBE;
END

dut I still have the problem. The problem is the same with the problem you have when you do cubemapping with the fixed pipeline without enabling the texgens.
How I will enable the texgens with the ARB_fragment_program?
thank you!
im not sure about this but i think you can enable TexGen as normal on the texture unit, if not you're gonna have to find the equations used in the TexGen params (maybe the oss.sgi.com repository) and code them into the ARB_fragment_program.

here is a fragment program i found on the net that uses cube mapping, maybe take a look see at what they use

http://www.vtr-hardware.com/divers/fichiers/interaction.vfp

you might also wanna try Humus' website

"I am a donut! Ask not how many tris/batch, but rather how many batches/frame!" -- Matthias Wloka & Richard Huddy, (GDC, DirectX 9 Performance)

http://www.silvermace.com/ -- My personal website

This topic is closed to new replies.

Advertisement