Jump to content
  • Advertisement
Sign in to follow this  
EnlightenedOne

Migrating to GLKit Skybox Effect not working.

This topic is 2530 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all,

I have been migrating from OGLES2 Oolong to GLKit

Has anyone got a GLKSkyboxEffect to work? I am keen for an example of what people plug into the transforms, I have very little to go on.

Here is all code relating to the skybox effect.

glkSkyShader = [[GLKSkyboxEffect alloc] init];

glkSkyShader.textureCubeMap.name = [uzEngineState getVolWeather]->getCubeTexture(i);
[glkSkyShader setCenter:GLKVector3Make(0, 0,0)];
[glkSkyShader setXSize:SKYBOXSIZE];
[glkSkyShader setYSize:SKYBOXSIZE];
[glkSkyShader setZSize:SKYBOXSIZE];

Draw Loop:

glkSkyShader.transform.projectionMatrix = GLKMatrix4MakePerspective((float)CAMERAFOV, (float)460/(float)320, (float)1, (float)10);

glkSkyShader.transform.modelviewMatrix = GLKMatrix4MakeLookAt(3, 1, 0, 0, 0, 0, 0, -1, 0);

[glkSkyShader prepareToDraw];

[glkSkyShader draw];

Is there something you have to bind before you draw it? The resulting mess of pixels looks vaguely like a view frustum/one of my models. Below is the skybox and the model it looks like. The textures shown are from Oolong engine I do not own them.

[attachment=5778:screenshot.jpg]

Thanks
EnlightenedOne

Share this post


Link to post
Share on other sites
Advertisement
No one has read this and I have solved it after realising the skybox was using the vertex data from a model built after itself.

I just had to add a call to glBindVertexArrayOES(0); after drawing the skybox.

I do wish the delete thread button was reinstated for these embarrassing moments :P

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!