can somoene explainn for me what imply “cube_map.vert” and “cube_map.frag” and “u_cubeTex” on this code:
auto texturecube = TextureCube::create(“left.jpg”, “proper.jpg”, “prime.jpg”, “backside.jpg”,“entrance.jpg”, “again.jpg”);
//set texture parameters
Texture2D::TexParams tRepeatParams;
tRepeatParams.magFilter = GL_NEAREST;
tRepeatParams.minFilter = GL_NEAREST;
tRepeatParams.wrapS = GL_MIRRORED_REPEAT;
tRepeatParams.wrapT = GL_MIRRORED_REPEAT;
texturecube->setTexParameters(tRepeatParams);
//create a GLProgramState utilizing customized shader
auto shader = GLProgram::createWithFilenames(“cube_map.vert”, “cube_map.frag”);
auto state = GLProgramState::create(shader);
// cross the feel sampler to our customized shader, state is a pointer of GLProgramState, u_cubeTex is a uniform in shader
state->setUniformTexture(“u_cubeTex”, texturecube);
additionally when i take advantage of skybox with folowin code it’s be with out colours can somoene assist?
code:
// create a texture dice
auto textureCube = TextureCube::create(“left.jpg”, “proper.jpg”,“prime.jpg”, “backside.jpg”,“entrance.jpg”, “again.jpg”);
//create a skybox
auto skyBox = Skybox::create();
skyBox->retain();
//set dice texture to the skybox
skyBox->setTexture(textureCube);
addChild(_skyBox);