Original Post
🔒 Locked
Z Buffer Problems
Advertisement
You should email nes8bit, he probably knows. Just kidding, is this OpenGL or Direct 3D??? Give some code that you are using.
---
www.crazycrackerz.org
---
www.crazycrackerz.org
Does pd3dDev->Clear() return ok, or does it by chance give "no z-buffer present"? (And do the z-write render state changes return ok?) What do you mean the z-buff "doesn''t go back to normal"?
I never looked into that.
After I set the renderstate to no writing to the zbuffer, it doesn''t want to go back. I''m wondering if I have to do something when I create the zbuffer surface or if it''s simply a driver problem. I will look into the zbuffer clears when I get back to my computer.
------------------------
After I set the renderstate to no writing to the zbuffer, it doesn''t want to go back. I''m wondering if I have to do something when I create the zbuffer surface or if it''s simply a driver problem. I will look into the zbuffer clears when I get back to my computer.
------------------------
Thanks guys for trying to help, but I found out it was a driver problem. I''m still not sure if its a driver problem, but I fixed it. If you ever get this problem, follow the pseudo code.
int i;
i = D3DDev.GetRenderstate(D3DRENDERSTATE_ZWRITEENABLE)
D3DDev.SetRenderstate(D3DRENDERSTATE_ZWRITEENABLE,False)
// Do particle effects here
D3DDev.SetRenderstate(D3DRENDERSTATE_ZWRITEENABLE,i)
it''s a very simple solution
------------------------
int i;
i = D3DDev.GetRenderstate(D3DRENDERSTATE_ZWRITEENABLE)
D3DDev.SetRenderstate(D3DRENDERSTATE_ZWRITEENABLE,False)
// Do particle effects here
D3DDev.SetRenderstate(D3DRENDERSTATE_ZWRITEENABLE,i)
it''s a very simple solution
------------------------
Uh, nes, that doesn''t look like a driver issue. It''s more of a logic one
.
See this:
Basically what your doing is turning on the Zwriting when you are drawing the particles, then turning it off as soon as your done.
(You need to do the opposite
)
So instead, do this:
--TheGoop
See this:
quote:
If UseZBuffer Then Direct3DDevice.SetRenderstate D3DRENDERSTATE_ZWRITEENABLE, True
''// Draw Particles Here
If UseZBuffer Then Direct3DDevice.SetRenderstate D3DRENDERSTATE_ZWRITEENABLE, False
Basically what your doing is turning on the Zwriting when you are drawing the particles, then turning it off as soon as your done.
So instead, do this:
If UseZBuffer Then Direct3DDevice.SetRenderstate D3DRENDERSTATE_ZWRITEENABLE, False
''// Draw Particles Here
If UseZBuffer Then Direct3DDevice.SetRenderstate D3DRENDERSTATE_ZWRITEENABLE, True
--TheGoop
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement