Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Cubemap shader opengl3.3+

$
0
0

@vbourbeau wrote:

Hi,
I’m beginer in openGL so I try to use OpenFramework to help.
I want to do a Cubemap I try with ofxCubeMap and ofxSkyBox. It’s work with ofxSkyBox but form my project I need to make it work with opengl3.3+
I think the shader are not compatible. Is some one can help?

Vertex

void main(void) 
{
 	vec4	texcoord0 = gl_ModelViewMatrix * gl_Vertex;
	//texcoord = texcoord0.xyz;
	texcoord = normalize(gl_Vertex.xyz);

    gl_Position    = ftransform();
   
}

Frag

uniform samplerCube EnvMap;

varying vec3  texcoord;

void main (void)
{
   
    vec3 envColor = vec3 (textureCube(EnvMap, texcoord));
	//vec3 envColor = vec3 (textureCube(EnvMap, gl_TexCoord[0]));

    gl_FragColor = vec4 (envColor, 1.0);
}

thank you

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles