Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Setup()
- {
- loader(tree);
- //Parameter handling
- glShadeModel (GL_SMOOTH);
- glEnable(GL_DEPTH_TEST);
- glDepthFunc(GL_LEQUAL); //renders a fragment if its z value is less or equal of the stored value
- glClearDepth(1);
- // polygon rendering mode
- glEnable(GL_COLOR_MATERIAL);
- glColorMaterial( GL_FRONT, GL_AMBIENT_AND_DIFFUSE );
- //Set up light source
- GLfloat light_position[] = { 0.0, 30.0, 50.0, 1.0 };
- glLightfv( GL_LIGHT0, GL_POSITION, light_position);
- float ambient = 0.45;
- float diffusion = 0.1;
- float specular = 0.55;
- GLfloat ambientLight[] = { ambient, ambient, ambient, 1.0 };
- GLfloat diffuseLight[] = { diffusion, diffusion, diffusion, 1.0 };
- GLfloat specularLight[] = { specular, specular, specular, 1.0 };
- glLightfv( GL_LIGHT0, GL_AMBIENT, ambientLight );
- glLightfv( GL_LIGHT0, GL_DIFFUSE, diffuseLight );
- glLightfv( GL_LIGHT0, GL_SPECULAR, specularLight);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
- glEnable(GL_CULL_FACE);
- //glEnable(GL_CULL_FACE | GL_CULL_FACE_MODE);
- glFrontFace(GL_CW);
- glEnable(GL_BLEND);
- // incoming // // stored //
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- // Black background
- glClearColor(0.0f,0.0f,0.0f,1.0f);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement