Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


XMaterial

Member Since 20 Jan 2011
Offline Last Active Feb 05 2011 04:51 AM

Posts I've Made

In Topic: problem with broken fragment improperly rendering

22 January 2011 - 10:34 PM

I'm not sure that my notes can fix your problem... but...

(in "main" function)

GL_DEPTH_BITS is not used for glClear (it's for glGetIntegerv that returns a value of number of bits containig depth buffer of current applied GL context)...

You can use "gl" and "glu" commands only after created and applied GL context (it's initializing by glutCreateWindow(...) on a GLUT API)... otherwise it gives you an error at glGetError() (!=0)...

Comparing of two pictures. my opinion is: "Depth buffer is not initialized (not exist) or you are using invalid parameters for visualizing the scene)..."

Check out your code (in "reshape" function):

"gluPerspective(45.0,w/h,0.0,5.0);"

Znear plane must be > 0 (make a modifications with it to 1.0)...

like this:

"gluPerspective(45.0,w/h,1.0,5.0);"



thank you very much it works very well now as u mentioned because of sending the wrong parameter to the gluPerspective routine the depth buffer was not initialized correctly.after i correct it.the model turned dark partly due to the light,but obviously the tire hided the component behind it that`s remarkable!


In Topic: problem with broken fragment improperly rendering

21 January 2011 - 08:13 PM

Can you introduce a model (as "how it must looks like") ? for better searching of the problem...


some other tools showed what that model should be look like perfectly(i am gonna upload the pic later),since it`s just an earlier version of drawing models with non-texture lighting support,the model should be rendered and composed of some smooth and non-textured solid objects,when i say "smooth" i mean the deeper points should be hidden by nearer points other than nearer points hidden by deeper points(i`ve already clear the depth buffer b4 rendering).take a look at my newest picture.



In Topic: Specular light shade on texture mapped objects

21 January 2011 - 09:06 AM

Might be a newbie ques.
I cant find code examples of how to put specular light shade component a texture mapped object. The program i'm writting the specular light shade only appear non-texture mapped objects. Does any one have a code example or program of specular highlight on textures to share? thanx



actually i am doing the same job take a look at my post http://www.gamedev.net/topic/593514-problem-with-broken-fragment-improperly-rendering/ but i do believe that specular light have obvious effect on my non-texture model because when i turn down the specular component of light the model changed. undoubtedly u should specify the normal per pixel b4 assigning the light that`s as far as i know hope it helps.but i`ve no idea how those broken fragment came out.let me know anything u hit after another try.

PARTNERS