Archived

This topic is now archived and is closed to further replies.

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

Recommended Posts

ok...i can''t get anything other than a one from my z-buffer. yes i''m clearing it. Yes i''m checking after i render . z-buffer init code....

glEnable(GL_DEPTH_TEST);
glClearDepth(1.0f);
glDepthFunc(GL_LEQUAL);

read code...MouseX and MouseY are window coordinates...

float MouseZ = 1;
RECT r;
GetWindowRect (Driver->hWnd ,&r);
float MouseY2 = r.bottom - r.top - Driver.TitleSize - MouseY;


i can read color values fine, but z-buffer values don''t give me anything but a one. thanks for help

Share on other sites
float mouseX

check the spec i think those floats have to be ints.

anyways
>>float MouseY2 = r.bottom - r.top - Driver.TitleSize - MouseY;<<

i can see that easily going wrong

chuck this just before the read to see if that points actually on the screen
printf("%d\n", mouseY );

-------------

glClearDepth(0.445f);
try it now if it saiz 0.445 then its not seeing anything under the mouseX,mouseY position are u sure youve drawn something there

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share on other sites
Problem can be in creating gl window.

Make sure you use 32 and TWO buffers.
Dont know why but if you using triple buffering you SOMETIMES cannot use glReadPixels

ah and more:
glClearColor (or something like that)

Share on other sites
my z-bits are 32, and i''m using double buffering, yes i am rendering before I test. It works with everything BUT DEPTH_COMPONENT (LUMINANCE, RED, BLUE etc...) but why not depth?!?!?! this is sooo frustrating. Everything i have coded until this has gone soo smoothly