Sign in to follow this  
Unreal

Problem with CubeMapping And ARB_fragment_program

Recommended Posts

Unreal    124
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!

Share this post


Link to post
Share on other sites
Unreal    124
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.

Share this post


Link to post
Share on other sites
silvermace    634
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.

Share this post


Link to post
Share on other sites
Unreal    124
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!

Share this post


Link to post
Share on other sites
silvermace    634
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this