GM Per-Pixel Bumpmapping

Posted by Adventus on May 3, 2007, 9:48 p.m.

Yea i did it, and pretty fast too…. You can check out the GMC topic (and get the source) here:

L3S_Bumpmapping

It basically works by spliting the Dot3 blendmode into 3 seperate multiplies & add passes, although theres alot more to it than that. And yes this is true perpixel bumpmapping, just the same as you'll see in modern games, i really cant find any flaws in it. Using some wizardry i managed to get it to work without additional surfaces and only 2 additional sprite renders. I should really thank OpticalLiam for getting me interested in GM lighting again.

In other new, my fancies have wandered and i've begun making the shift from GM to C++. To ease the transition i've started using Ogre3d and inspired by Toon-Master i've begun making a GM framework. Im in limbo whether i should finish Tribal before i move on…. what do you guys think?

Cheers,

EDIT: What's with this blog randomly being removed from the front page….

Comments

Adventus 17 years, 6 months ago

Quote:
Impressive. I get ~220 FPS on a 2.8 GHz with 256MB 6600.
Yea, and thanks for bumping the GMC topic…. it didnt want it to die before anybody really said anything.

Also ill upload a new example in a few minutes which has some better bumpmaps in it.

Firebird 17 years, 6 months ago

900-1000 FPS on my rig (Intel core2 E6600 @ 2GHz, 2GB DDR2 800, nVidia 8800GTS 640MB)

Adventus 17 years, 6 months ago

Quote:
900-1000 FPS on my rig (Intel core2 E6600 @ 2GHz, 2GB DDR2 800, nVidia 8800GTS 640MB)
haha, if only every one had a machine like that…. then GM might actually be useful…. XD.

Bryan 17 years, 6 months ago

It's done before you.

I once tried this too I failed I could get it kind of right, but there kept beeing glitches so ye…

Anyways

Good job it's really nice.

You still have to finish L4S tho. Otherwise I'm making my own light lib for nothing T_T

*screenie*

http://64digits.com/users/bryan/asdfx.JPG

Oh, would you mind if I try to do c++ with you guys?

Firebird 17 years, 6 months ago

C + +!!!

OL 17 years, 6 months ago

Pretty good, but it didn't seem to work so well… maybe it was the normal maps you used. Definitely not the first, but good job all the same.

omicron1 17 years, 6 months ago

It works by taking five images of various parts of a sprite (those lighted by left, right, up, and down - directional lighting, as well as a static sprite) and rendering them with varying alphas according to the direction to a light source. I had a topic on the GMC about it dated from January 2006

Adventus 17 years, 6 months ago

Quote:
It works by taking five images of various parts of a sprite (those lighted by left, right, up, and down - directional lighting, as well as a static sprite) and rendering them with varying alphas according to the direction to a light source. I had a topic on the GMC about it dated from January 2006
BEEP Wrong! Its got a lot more to it than that, i dont even use alphas. For instance if you knew the dot3 bumpmapping formula you would see (n=normal,l=light):

result = n.x*(x-l.x) + n.y*(y-l.y) + n.z*(z-l.z)

Sure Its really easy to split into 3 renders:

result = 0;

result += n.x*(x-l.x)

result += n.y*(y-l.y)

result += n.z*(z-l.z)

But tell me this, how do you get the (x-l.x) component on a perpixel basis? You see…. now your screwed. My one does get that component on a perpixel basis…. So stop giving me this shit about, been their, done that…. until you actually understand how it works.

Whilst its not the first approximation, I think it is the most accurate (100% by my calculations). I can do anything shitly, doing it well is another question.

Quote:
Pretty good, but it didn't seem to work so well… maybe it was the normal maps you used. Definitely not the first, but good job all the same.
The best example is the ground texture, its not as obvious, but look at the pic in the GMC topic and you can see little humps everywhere.

foslock 17 years, 6 months ago

200 fps all around.

Nicely done.

Toon-Master 17 years, 6 months ago

I decided to Google my name XD and found this. I also realised I haven't used GM for awhile haha. (Yeah this comment might be too late)

I finally got a new computer now so I could see the surfaces in action. I like the coding and output. It's very interesting stuff. My FPS was around 300 and over.

Thanks for mentioning me haha.

- Toon-Master