Texture Problem --> Help Me

hi all,

i would like to know " how to map texture to the box & draw a normal sphere with color at the same project?" i don’t know how to write the fragment file…

so, who can help me solve this problem? let’s show me the sample code…

Why don’t you download RenderMonkey from ati.
In the workspace, right click “Effect Window”, choose
Add Effect -> OpenGL -> Textured

The shaders it generates are

//VERTEX SHADER
varying vec2 Texcoord;

void main( void )
{
    gl_Position = ftransform();
    Texcoord    = gl_MultiTexCoord0.xy;
    
}
//FRAGMENT SHADER
uniform sampler2D baseMap;

varying vec2 Texcoord;

void main( void )
{
    gl_FragColor = texture2D( baseMap, Texcoord );
    
}

This does standard texture mapping by reading baseMap. It will work for any geometry.

When you are done learning GLSL, then you can write your own app, making GL calls yourself.

Thanks, V-man …

But i would like to get the full simple source code that can compile on VC++.

Can you help me?

It’s not available through RM.
FYI, some people have written tutorials. A search on this site will provide some links.
ATI’s and NV’s GL SDKs probably have examples you can look at.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.