Game Development Community

dev|Pro Game Development Curriculum

TGE Patch: Terrain Bump Mapping

by Tim Gift · 05/12/2003 (9:36 am) · 85 comments

Download Code File

[Notes from Chris]
...
Also, one thing that should be noted is that in putting in BumpTexture and InvertedBumpTexture texture types into gTexManager, both BumpTexture and InvertedBumpTexture both use trilinear filtering only because bilinear looks horrible. You can really see a sharp contrast between mip levels.

And, the bump texture I provided is detail1.png with a contrast filter on it using MS Photo Editor, and I noticed as I zoomed in that there are seems long 1 side. So, it tiles perfectly in one direction, but not the other. But, you can't tell unless you zoom in. So it may need to be replaced with an actual bump texture example.
Page «Previous 1 2 3 4 5 Last »
#1
05/12/2003 (9:38 am)
This feature was apparently part of the Day/Night cycle resource Chris posted earlier. Has anyone tried this with the DirectX? I should have a chance to try this out soon.
#2
05/12/2003 (10:27 am)
Great! :)
#3
05/12/2003 (11:50 am)
UPDATED 7/2/03
This revision is most likely the FINAL revision, and the one that will probably go into the next version of torque. I have fixed what I think are all issues, including getting it to work on ATi cards and the D3D renderer.
IMPORTANT!! IF YOU HAVE NOT PATCHED YET:
Grab THIS file and use it instead of bump.patch in the codefile. (Updated yet again)
IF YOU HAVE PATCHED PRE-7/2/03 PATCH:
Undo all changes and patch with the linked patch (bumpy.patch). (Yeah, I know i should get better names...)

And now, back to your regularly scheduled comment...

The two are seperate things, but they can be intertwined in order to get a more dramatic effect.

Also, please let me know of any bugs/crashes with this code, and I'll get on it ASAP.

EDIT: Heh, just for kicks I tried running in D3D and it crashes... I'll see if I can fix it today. By the way, is there a way I could update this myself?

RE-EDIT: It appears that the problem is that the bump maps draw BEFORE the vertex buffer is set. I really don't know much about D3D, so sadly, I doubt I'll be able to do anything about it. If you move the locking of the vertex buffer before the bump map render, then it doesn't CRASH (at least in this case) but you get about 20% the FPS and artifacts EVERYWHERE - stuff is rendering all over the place. What the actual problem is, I have no clue, and someone with a little D3D knowledge should be able to figure it out by looking at it. Hopefully. :)
#4
05/12/2003 (12:30 pm)
For those of you who use terrain manager... You can download this patch it's a version I've been sitting on waiting for this to become an official resource. Be warned, I've noticed some odd texture corruption when using TM + bump mapping + day night cycles that I've not had a chance to look into. I think it's related to the sun angle changing the bump map but I'm not sure. The whole day/night thing doesn't seem to mesh well with TM.

Oh and... It looks sharp good job Chris.
#5
05/13/2003 (12:44 pm)
It appears that my problems were related to not having an fxSunlight object in my mission. This also prevented shadows from having the proper angles since the "TrueSunVector" is calculated off of the SunFlare object.
#6
05/13/2003 (7:16 pm)
Nice resource... I like it.

Any idea how to make the bump effect bigger?
The game I'm developing uses fairly fast moving flying ships and the effect is really only noticable very close to the ground and when moving slowly.

My openGL knowledge isn't too good, couldn't work it out myself.
#7
05/14/2003 (10:03 am)
Awesome job!

This resource makes the terrain rendering look about a thousand times better.

I've only noticed a very slight drop in framerate also.
#8
05/14/2003 (11:28 am)
@Donovan: Use getSunVector() - it's more stable and works well with shadows. getTrueSunVector() should only be used if you know what you're doing. I used it for the bump mapping and for the water project I'm working on because in the middle of the night, getSunVector will light up everything using normal OpenGL lighting. I needed a new function that would actually calculate a circular sun vector, which is getTrueSunVector().

If you don't know exactly what a function does, look at the function code itself. I tried to comment it up pretty well, but of course I probably missed some things. If you have any further questions about it, post it on it's resource page or drop me an email. I try to check the resource pages pretty often, and I check my email (and respond) religously.
#9
05/14/2003 (11:36 am)
can someone point me to directions on how to actually apply the patch please? :\
#10
05/14/2003 (11:52 am)
From the "Submitting patches page:
Quote:
Apply the patch from the command line: (assuming your test copy of the source is in the "c:\test"):

cd c:\test
patch -p0 < ..\patchname.patch

Basically, you need to put the patch file in the directory under the "torque" directory, then goto the command prompt, goto the torque directory, then type "patch -p0 < ../bump.patch"

EDIT: I can't spell :\
#11
05/14/2003 (1:58 pm)
WOW! this is awesome!
your the man, hobbit!
#12
05/15/2003 (1:13 pm)
I am either real tired and missed something or something. When I try to run the patch I get this:

C:\test>
C:\test>patch -p0 < ..\bump.patch
Bad command or file name


My test torque is in c:\test and bump.patch is in c:\torque.

I read the documentation but I must be misinterpreting or something. I don't want to be a pain in the a** but could someone go over how to apply a patch step by step. Did I need to download something?
#13
05/15/2003 (1:42 pm)
Chris/J.D. . . . I'm using Terrain Manager. The link that J.D. doesn't patch very well against yesterday's HEAD 05-13-2003 from GG. Should I use the patch in the zip file instead?
#14
05/15/2003 (5:52 pm)
michael: you have wincvs installed? if you dont, install it, if you do make sure you have a windows environment variable named PATH

and its value should be the path to the directory that wincvs.exe is in. for example my value for PATH is:

C:\Program Files\GNU\WinCvs 1.2\
#15
05/15/2003 (10:31 pm)
think i found something, i dont know if its just me or will this happen for anyone.

load a mission that has some bump mapped terrain, then alt+tab out then come back. for me the bump map dissappears and all thats left is the png file of the bump map all over the place like a texture.
#16
05/16/2003 (2:13 am)
very excellent resource Hobbit, makes a huge difference in quality for having such a slight performance hit.

One thing I've noticed is while underwater (pond in scorched planet) and looking up, you don't really see the sky, instead you see the bumpmapped ground underneath you?

Anyways, great work :D
#17
05/16/2003 (5:18 am)
Ok got it down now. Thanks ryan your help with a few good hours of sleep helped out alot.

Now i'm going to follow my own plan and stay away from the computer for a few days and relax. I just had to check out this resource.

BTW This resource is great.

Thanks Coz
#18
05/16/2003 (11:12 am)
What sort of graphics cards are you guys running? I'm using a Radeon 9700 and the bump mapping looks a little wierd in OpenGL mode, and is totally messed up using the DX wrapper...
#19
05/16/2003 (1:32 pm)
Geforce 1 forget the actual name. I get the messed up using d3d but openGl works great.
#20
05/16/2003 (3:09 pm)
im running msi geforce4 ti4600

http://cxassassin.digitalrice.com/gg/d3d.jpg

http://cxassassin.digitalrice.com/gg/opengl.jpg
Page «Previous 1 2 3 4 5 Last »