Jump to content
  • Advertisement
Sign in to follow this  
luasitdown

why skybox so complex?

This topic is 4825 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

I see some skybox sample code. there are many line . I surprise I just a box or semi-sphere model and add a texture close z-buffering and light everything is ok. if want a good skybox, just do good texture. so why need so many code to create sky??

Share this post


Link to post
Share on other sites
Advertisement
No offense but get off the drugs. :P j/k

Disable(DEPTH_TEST);
PushMatrix();
Translate(camera_position);
Color(255,255,255,255);

BindTexture(front_texture);
Render(front);

BindTexture(back_texture);
Render(back);

BindTexture(left_texture);
Render(left);

BindTexture(right_texture);
Render(right);

BindTexture(top_texture);
Render(top);

BindTexture(bottom_texture);
Render(bottom);

PopMatrix();
Enable(DEPTH_TEST);

This isnt actual code but thats about the process I use to render mine.

Share this post


Link to post
Share on other sites
My skyboxes are also very simple things. I render a quad (unlit, no Z) at the camera position six times in the different orientations to make a cube with a different texture each time. Very little code.

If you do some effects or other dynamic type things, the code will increase considerably.

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!