Game Development Community

bug in terrain rendering ?

by Frank Bignone · in Torque Game Engine · 02/19/2002 (12:47 pm) · 11 replies

I rebuild all my appli today and now I have a weird bug. When displaying a terrain, I have triangles totally messed popping everywhere on the screen. This happens only on my laptop (ATI Rage pro, latest drivers), and previous release works well (old one).

About the author

Real programmers don't waste time recompiling; they patch the binary files... ... Real programmers don't waste time patching binary files; they patch memory.


#1
02/19/2002 (12:54 pm)
After looking at two different version of the files, I came up with this little change. In fact, I disable the NPatch, and now it works fine. However, it should have been done during game execution, shouldn't be ?

#if ENABLE_NPATCH
#define TERRAIN_STORE_NORMALS          0   // which will allow NPatched terrain.
#endif

BTW, I'm working with the D3D driver for the laptop.
#2
02/19/2002 (1:05 pm)
I made another test. This bug does not happen in opengl but only on D3D (I have the latest directx 8 driver for the card)
#3
02/19/2002 (1:22 pm)
And setting TERRAIN_STORE_NORMALS to 0 helps with this D3D bug??
I tried that, but I still get all polys messed up...
#4
02/19/2002 (1:26 pm)
D3D mode is all mssed up for alot of different video cards. GeForce 3 and GeForce 2 cards and even voodoo cards have problems sometimes. I recommened you start opengl mode simply because it is ALOT faster.
#5
02/19/2002 (5:22 pm)
Good One Frank. That small change made my D3D polygon problem go away !

It may or may not decrease performance, but it functions now :-)
#6
02/19/2002 (11:56 pm)
@Stephan
yes setting TERRAIN_STORE_NORMALS to 0 helps me to solve the problem.

However be careful to remove all .obj files for the terrain (terr*.obj) as sometimes VC6+ did not recompile everything... another weird bug ... ;) and it was mainly the reason why I found this bug (about terrain) only yesterday !
#7
02/20/2002 (12:11 am)
Thanx very much, dude!!!
That works - I had to make a "Clean" on the project, recompiled it and now D3D works fine for me, too!!

Does anyone of the GG employees have an explanation for this TERRAIN_STORE_NORMALS stuff? What is it supposed to do? Any problems with the engine if we set this to 0?
Anyhow, it works now... :-)
#8
02/20/2002 (1:00 am)
@stefan : you're welcome dude :)

@Thomas : problem with opengl is that it's way to slow on my laptop :(
#9
02/20/2002 (6:20 pm)
TERRAIN_STORE_NORMALS is work-in-progress associated with NPatching the terrain. I mentioned it to Tim last week -- good to know that's the issue. NOW, we need to figure out what the D3D code is doing/assuming that the STORE_NORMALS code is causing it issues, and not causing GL itself any issues...

Turning it off, or ENABLE_NPATCH, won't 'hurt' anything. If you're not on a Radeon 8500, the associated code won't really do anything.

The problem must be associated with something in D3D assuming structure layout or size and not referencing the terrain header. Or something like that.

Tim was going to look into it this week -- I've been tied up with paying work, and haven't had ANY time in the past few weeks since the Mac code release (as I needed to catch up on real stuff that fell behind in getting Torque out the door... ;).

(Tim - feel free to disable STORE_NORMALS by default until we can solve it...)

d
#10
02/21/2002 (10:30 am)
Thanks Frank! I disabled it for now, David or I will have to check out the D3D driver and see what's up.
#11
12/15/2002 (11:17 pm)
Which file does that change go in I am having the exact same problem