1[VS] 2#include "g_attributes.glsl:VS" 3#include "u_uniforms.glsl" 4#include "skinning.glsl" 5#include "common.glsl:VS" 6 7varying vec3 v_cubeMapUV; 8 9void main() { 10 g_position = u_worldTrans * applySkinning(g_position); 11 v_cubeMapUV = normalize(g_position.xyz); 12 gl_Position = u_projViewTrans * g_position; 13} 14 15 16[FS] 17#ifdef GL_ES 18#define LOWP lowp 19#define MED mediump 20#define HIGH highp 21precision mediump float; 22#else 23#define MED 24#define LOWP 25#define HIGH 26#endif 27 28varying vec3 v_cubeMapUV; 29 30#ifdef environmentCubemapFlag 31uniform samplerCube u_environmentCubemap; 32#endif 33 34void main() { 35 36#ifdef environmentCubemapFlag 37 gl_FragColor = vec4(textureCube(u_environmentCubemap, v_cubeMapUV).rgb, 1.0); 38#else 39 gl_FragColor = vec4(v_cubeMapUV, 1.0); 40#endif 41} 42