normalmapping animated meshes

Community Forums/Graphic Chat/normalmapping animated meshes

MSW(Posted 2004) [#1]
I think I've got this mostly sussed out, working in realtime without messing around calculateing normals and such.

This here is the dragon.md2 model animated in it's run cycle with a funky sci-fi-ish normal map applied to it just to test the effect...

This uses a tiny 2 by 2 pixel cubemap for the normals.
Another tiny 2 by 2 cubemap to give the lighting some color.
normal maps and regular diffusion maps.

The landscape is actualy a mesh (not a blitz terrain) as I was useing it for something else...but both it and the dragon are rendered with the same normal and light color cubemaps, both can be rotated in anydirection and the lighting remains consistant as if this used unmoveing hardware lights...although because of the "wobblies" MD2s have it tends to 'pop' the surface lighting a bit...the fog is just there to see how DOT3 works with it.



I'll pack up a zip, source and all when I get back home from work.


Red Ocktober(Posted 2004) [#2]
cooooool... can't wait to see the demo as well as the details...

THANKS...

--Mike


boomboom(Posted 2004) [#3]
Cool. If someone could make an easy/fast normal map system, i am sure alot of people would use it (or pay for it)


TartanTangerine (was Indiepath)(Posted 2004) [#4]
I look forward to seeing this :)


BlitzSupport(Posted 2004) [#5]
Me too!


puki(Posted 2004) [#6]
Me three!


MSW(Posted 2004) [#7]
details?

well, there isn't much to it really...it's just multi-textureing ...

here is the code that generated the above screen shot:
;modified from Marks original dragon sample 
;this it just to test normal mapping
;need GFX card that supports DOT3, Mod2, and multitextureing

;Cube2.png = a 12 by 2 pixel cubemap containing normals converted to colors
;Lcube.png = a 12 by 2 pixel cubemap containing lighting colors
;rockbump.bmp = a normal map of a rocky surface
;Normit.bmp = a normal map of a sci-fi-ish surface
;mossy.jpg = a regular texturemap used on the landscape.3ds mesh
;dragon.bmp = regular texturemap used on the dragon.md2 mesh 

Global info1$="Dragon Normalmapping Demo"
Global info2$="Use arrows keys to pan, A/Z to zoom"
Global info3$="MD2 Dragon model courtesy of Polycount"

Include "../start.bb"

; If user's graphics card does not support cubic mapping then quit example 
If GfxDriverCaps3D()<110 Then RuntimeError "Sorry, your graphics card does not support cubic environemnt maps." 

;camera
camera=CreateCamera()
cam_xr#=30:cam_yr#=0:cam_zr#=0:cam_z#=-100

CameraFogMode camera,1
CameraFogRange camera,1,375
CameraFogColor camera,128,128,200
CameraClsColor camera,128,128,200

;cubemap for normals
nmap=LoadTexture( "cube2.png",1+128 )
SetCubeMode nmap,2
TextureBlend nmap,2

;cubemap for lightcolor
lmap=LoadTexture( "lcube.png",1+128 )
SetCubeMode lmap,2
TextureBlend lmap,2


;environment 
land=LoadMesh("landscape.3ds")
FitMesh land, -400,-100,-400,800,200,800
EntityFX land,1

landtex=LoadTexture("mossy.jpg")
TextureBlend landtex,5

landbump=LoadTexture("rockbump.bmp")
TextureBlend landbump,4

ScaleTexture landtex,.5,.5
ScaleTexture landbump,.05,.05

EntityTexture land,nmap,0,0
EntityTexture land,landbump,0,1
EntityTexture land,landtex,0,2
EntityTexture land,lmap,0,3


;cool dragon model!
dragon=LoadMD2( "model\dragon.md2" )
EntityFX dragon,1


dragonbump = LoadTexture("normit.bmp")
TextureBlend dragonbump,4
ScaleTexture dragonbump,.25,.25

dragonskin = LoadTexture("dragon.bmp")
TextureBlend dragonskin,5


EntityTexture dragon,nmap,0,0
EntityTexture dragon,dragonbump,0,1
EntityTexture dragon,dragonskin,0,2
EntityTexture dragon,lmap,0,3

AnimateMD2 dragon,1,.09,40,46



;main loop
While Not KeyHit(1)


;turning the meshes to see the lighting effect it
;TurnEntity land,0,.1,0
;TurnEntity dragon,0,.1,0


;change dragon animation seqence
    If KeyDown(57) Then AnimateMD2 dragon,1,.1115,0,40
    If KeyDown(2) Then AnimateMD2 dragon,1,.1115,40,46
    If KeyDown(3) Then AnimateMD2 dragon,1,.1115,46,54
    If KeyDown(4) Then AnimateMD2 dragon,1,.1115,54,58
    If KeyDown(5) Then AnimateMD2 dragon,1,.1115,58,62
    If KeyDown(6) Then AnimateMD2 dragon,1,.1115,62,66
    If KeyDown(7) Then AnimateMD2 dragon,1,.1115,66,72
    If KeyDown(8) Then AnimateMD2 dragon,1,.1115,72,84

;camera controls
	If KeyDown(203)
		cam_yr=cam_yr-1.5
	Else If KeyDown(205)
		cam_yr=cam_yr+1.5
	EndIf
	
	If KeyDown(200)
		cam_xr=cam_xr+1.5
		If cam_xr>90 cam_xr=90
	Else If KeyDown(208)
		cam_xr=cam_xr-1.5
		If cam_xr<5 cam_xr=5
	EndIf
	
	If KeyDown(26)
		cam_zr=cam_zr+1.5
	Else If KeyDown(27)
		cam_zr=cam_zr-1.5
	EndIf
	
	If KeyDown(30)
		cam_z=cam_z+1:If cam_z>-10 cam_z=-10
	Else If KeyDown(44)
		cam_z=cam_z-1:If cam_z<-280 cam_z=-280
	EndIf
	
;take a screen shot	
	If KeyDown(88)
	  ss$ = "screenshot" + Str MilliSecs() + ".bmp"
	 SaveBuffer(FrontBuffer(),ss$)
	End If
	
	PositionEntity camera,0,0,0
	RotateEntity camera,cam_xr,cam_yr,cam_zr
	MoveEntity camera,0,0,cam_z

	UpdateWorld
	RenderWorld
	Flip
Wend

End


I guess the big "secret" is to use cubemapping mode 2...the 'diffuse' mode.

The models are fullbrite white...the normals cubemap is multiplied atop it (generateing the surface colors for DOT3)...then the normalmap texture is DOT3 atop that generateing the "bumps" (end result is a greyscale rendering of the mesh...for colored lighting another cubemap is multiplied atop this)...then the regular texture can be multiplied or whatever atop that...

the cubemaps I used for the above screenshot and example code were made "by hand" in PSP...which has taken a lot of experimentation to get them to look decent...I've made them so small in an effort to test how they would look as well as explore the potential to modify them in real time without noticeable speed hits to the frame rate...

Also in that above screen shot I used the sfi-fi-ish normalmap on the dragon because I couldn't generate a good normalmap from the dragons skin texture that showed up well...mostly because the regular skin texture already has mock surface shadeing on it which tends to hide the "bumps" for the most part.


TartanTangerine (was Indiepath)(Posted 2004) [#8]
Can you please post your cubemaps and can you specify if the normal map is Tangent Space or Object Space..

Ta.


HNPhan(Posted 2004) [#9]
cool man, can you post this up with the media files? if you need hosting i can do it for you :)
just email me at
cgi008@...


Red Ocktober(Posted 2004) [#10]
yeah... zip up that bad boy and post it so we can run it as well... this is really kinda neat...



--Mike


MSW(Posted 2004) [#11]
TigerZ - thanks, I'm sending you a zip to your email...about 1.1mb as it includes everything (plus the dragon normalmap I made from the regular dragon skin).

indiepath.T - these are objectspace maps, or I suppose thats what they are called...the dragon.md2 isn't modified, as such it uses the exact same texture cords as it uses for the skin...so some areas of the model will seem to have inverted bumps (raised areas look lower, while lower areas are raised)..so it's far from perfect, but it does work pretty well considering that the effect doesn't involve additional runtime calculation or even true GFX card assembly implemented "shaders".

For the projects I have in mind that I'd like to use such a technique (a Final Fantasy Tactics like turn-basied strategy game) I think it works quite well.


gotelin(Posted 2004) [#12]
Can you send me code and media files, please?
edetanos@...

Thanks


MSW(Posted 2004) [#13]
Better yet TigerZ just sent me the link:

http://legion.gibbering.net/cgi008/normdemo.zip

It's a zip containing the images, and .BB files (a bit over 1MB ... I should have converted the larger images into .JPGs, but didn't have time)- just download, unzip, and load into Blitz3d...as long as everything is together in the same directory, and your PC can do DOT3, Mod2, and multitextureing - it should run fine...Have fun with it, comment out the textures you don't want to use to see how it effects things and all that (I included the dragon2.bmp normalmap created from the original dragon.bmp skin) rotate the dragon around, the landscape too...the "trick" isn't in the code, rather its the media...


gotelin(Posted 2004) [#14]
Thanks

Can I you animate model in B3d format? with LoadAnimMesh?

Thanks


Red Ocktober(Posted 2004) [#15]
i don't see anything... program runs ok, i get a light blue window... i press a,z,up,down but no dragon or scenery...

running Blitz3d 1.87 Radeon 9200 WinXP

boooo hoooo.....


--Mike


MSW(Posted 2004) [#16]
Ack!...there is a problem in that the start.bb file uses the Blitzlogo image, which I didn't include in the zip...sorry about that...just commet out those lines in start.bb or have it load another image.

Not sure what the issue is, Red Ocktober...at the start the dragon should be directly in front of the camera (faceing away) running in place...hmm...light blue window? maybe try turning off the fog code?

I'm running Blitz3D 1.87, winXP, Geforce 6800 GT and it's working fine...anyone else haveing this problem?


Can I you animate model in B3d format? with LoadAnimMesh?



I'm not sure what you mean...Yeah, I'm pretty sure a .B3D animated model would work well with this particular technique...its all done on the graphics card through multitextureing...the hardest part for me has been trying to figure out what colors to use on the normalmap cubemap used to "reflect" surface normals...a RGB color value of 127,127,255 is direct lighting where very little bumps will show up which corisponds to a XYZ normal value of 0,0,1...a RGB of 0,0,0 = a normal value of -1,-1,-1...a RGB of 127,127,127 = a normal value of 0,0,0 and a RGB of 255,255,255 = a normal value of 1,1,1


Red Ocktober(Posted 2004) [#17]
k... will do...

--Mike


Paolo(Posted 2004) [#18]
Hmmmmm!
This is interesing :)

So, after you apply the bump map, instead of applying the color to the model by EntityColor or VertexColor,
you use a cube map to apply color, that seems to be a good technique...
I will have to experiment a little more with it :)

Thanks MSW !

Mike,
Are you running in 32bit color?

bye!


Red Ocktober(Posted 2004) [#19]
HEY PAOLO!!!!

long time no see...

yes, i am tried both resolutions...

i'm finally about to give in and switch my code to a6 or torque... can't get rad to give me the graphics that i want (my fault partially as i need al the help i can get making a scene look good :) , and the dot3 bumpmapping available now really helps out a lot... rad can't do it, and i got no texture baking apps at hand, so... )

what you been up to lately...

--Mike


MSW(Posted 2004) [#20]

So, after you apply the bump map, instead of applying the color to the model by EntityColor or VertexColor,
you use a cube map to apply color, that seems to be a good technique...
I will have to experiment a little more with it :)



erm...not exactly.

There are two cubemaps...one is for normals...the other is for light color.

I first apply the cubemaps for the normals...which mimics changeing verticy/entity color, but without the actual processing time to do so....this texture is called nmap in the example code.

Then the "bump" maps is applied over that...landbump or dragonbump in the example

Then the "light color" cubemap is applied on that...this is to mimic colored lighting as the results of applying the DOT3 "bump" map are greyscale...this "light color" cubemap applied atop the bumps mimics colored lighting...this is called lmap in the example

finaly the actual diffuse skin texture is applied...landtex and dragontex in the example...you can swap the order around with this and the lmap "light color" map if you want, and they arn't needed to see the bumps


Red Ocktober(Posted 2004) [#21]
ok this is strange...

i copy the folder to a dx8.1, non shader video card (GeForce4), running xp...

replaced the b3dlogo...

ran it and it worked...


ok, so i compile to ex and cop it over to the Radeon 9200 system running dx 9.0c...

same results... light blue screen with nothing...

copied the entire folder back over to the Radeon 9200 machine... same...

ran it in various resolutions... same...



also...

in 16 bit mode on the machine that works, the scene elements are partially transparent...


also... tested on a win200, GeForce2, dx8.1 system and it ran fine... all resolutions


--Mike


gotelin(Posted 2004) [#22]
I can't use b3d format, why?

If I use loadanimmesh , I can't see normal mapping

Can you help me, please?

Thanks


HNPhan(Posted 2004) [#23]
well it works very well for me, and its rather ingenious idea MSW!

thanks alot for sharing :D


MSW(Posted 2004) [#24]

I can't use b3d format, why?

If I use loadanimmesh , I can't see normal mapping

Can you help me, please?



You might try calling updatenormals with the animated mesh once you load it in.


ok this is strange...

i copy the folder to a dx8.1, non shader video card (GeForce4), running xp...

replaced the b3dlogo...

ran it and it worked...


ok, so i compile to ex and cop it over to the Radeon 9200 system running dx 9.0c...

same results... light blue screen with nothing...

copied the entire folder back over to the Radeon 9200 machine... same...

ran it in various resolutions... same...



also...

in 16 bit mode on the machine that works, the scene elements are partially transparent...


also... tested on a win200, GeForce2, dx8.1 system and it ran fine... all resolutions



I kinda expected it would run a bit funny in 16-bit mode. But that is very strange, it not working, on the Radeon 9200...have you tried disableing the fog and running it? Or maybe just change the fog color from light blue to red or something just to see if it has any effect?

If not then try disableing the textures one by one, maybe try running it with just the diffuse skins on the dragon and land meshes, just to see if that much of it works...maybe some other radeon owners can test it too...I would hate for this to only work on Nvidia cards.

I've tested it with my 256MB Geforce 6800 GT and 64MB Geforce 4MX, both with DX 9.0b...maybe there is a problem with DX 9.0c?


Mustang(Posted 2004) [#25]
Allrighty, works perfectly here (R9600XT). I even tried 1600*1200*32... of course you have add manually the missing Blitz logo gfx-file and at least started the start.bb and wondered why it kicked me back to desktop... duh, not enough coffee this morning I guess! :)

So, it does seem to work even if I rotate the models, but the lighting itself is static (pre-renderd, baked, whatever), right?


MSW(Posted 2004) [#26]

So, it does seem to work even if I rotate the models, but the lighting itself is static (pre-renderd, baked, whatever), right?



yeah...although the cube maps are 12 pixel wide by 2 pixels high, tiny little things, only 24 pixels in total...and to make them seemless each of the edge pixels must be exactly the same color...so all in all there are only 8 unique colors in the entire cubemap...so it should be possable at run time to figure up what those 8 colors should be and modify the cubemap accordingly (either calc at run time or interpolate from some precalculated data)... at 4 pixels per side, by six sides...24 calls to writepixelfast shouldn't be too much of a speed hit, I'd think :)


gotelin(Posted 2004) [#27]
Excuse me.
But I don't undestabnd you with :

You might try calling updatenormals with the animated mesh once you load it in.

Can you post a example,please?
Thanks


Mustang(Posted 2004) [#28]
modify the cubemap accordingly (either calc at run time or interpolate from some precalculated data)...


That was my original idea when cubemaps came to Blitz3D... do a pre-calced 3 array of points inside the gamelevel, and the render tiny cubemaps from each of those points. Then you would just either choose or interpolate a cubemap that's most approriate to the moving, dynamic object inside the gamelevel... that way the lighting should match the lightmapped level static lighting pretty goog.


Braincell(Posted 2004) [#29]
Awesome.

Ok the next step is for someone to remake say a Doom3 scene with moving lights, of course including normal maps. Anyone?


Red Ocktober(Posted 2004) [#30]
ok MSW... i'm tryin' stuff to get it goin here on the R9200...

--Mike


MSW(Posted 2004) [#31]

Excuse me.
But I don't undestabnd you with :

You might try calling updatenormals with the animated mesh once you load it in.

Can you post a example,please?
Thanks




player = LoadAnimMesh( "Player.B3D" )
UpdateNormals player




MSW(Posted 2004) [#32]

That was my original idea when cubemaps came to Blitz3D... do a pre-calced 3 array of points inside the gamelevel, and the render tiny cubemaps from each of those points. Then you would just either choose or interpolate a cubemap that's most approriate to the moving, dynamic object inside the gamelevel... that way the lighting should match the lightmapped level static lighting pretty goog.



I was developing this normalmapping stuff for a Final Fantasy Tactics type turn-basied strategy game I've been working on...basicly only one character moves at a time, and what I was thinking of doing was precalculateing the normals cubemap and the colored lighting cubemap for each location on the map that a character can occupy...load this into a bank, and generate the cubemaps for each of the characters...then as the character moves from one location to next do a little "morph" on the characters cubemaps to change them to the maps of the location they are moveing to.

Problem is that invoves a whole lot of cubemaps, two for each character, and there could be two dozen or more characters on a map...video memory could handle it, but I'm not sure about surface counts...not to mention that larger maps would require a whole lot more bank memory just to store all the precalculated maps...so instead I'm working on a system that subdivdes the maps into zones or sectors...sort of how the Duke3D build engine had sectors, but here each has thier own set of cubemaps...every chacter in the same sector uses the same cubemaps...and when characters move to locations withing the same sector, the same cubemaps are used...but if they move into a different sector, a new temporary pair of cubemaps would be created- copies of the maps of the starting sector..then as the character moves, the temp maps are morphed to match those of the sector they are moveing into...and once they get to thier destination the temp maps are removed and the maps for that sector are assigned to the character...in this way I can change the lighting in a sector at runtime, effecting all the characters within it...without haveing to ajust individual cubemaps for each character...plus it saves memory as a 100 by 100 map before would have needed about half a megabyte to store 24 bytes for a normals cubemap and 24 bytes for a colored lighting cubemap for each location...instead if the map is subdivided into 256 zones or sectors, thats only 12k for all the maps to be stored in a bank...

still surface counts can become a problem :P


gotelin(Posted 2004) [#33]
I use:

player = LoadAnimMesh( "Player.B3D" )
UpdateNormals player

But is the same , if I use Loadanimmesh i can't see normal mapping but when use loadMesh can see normalmapping

Why?

Thanks


MSW(Posted 2004) [#34]

I use:

player = LoadAnimMesh( "Player.B3D" )
UpdateNormals player

But is the same , if I use Loadanimmesh i can't see normal mapping but when use loadMesh can see normalmapping

Why?

Thanks



I'm not sure, maybe try this:
UpdateWorld
UpdateNormals player
RenderWorld
Flip


another thing to try, create a directional light...you won't really be useing it...but turn off the fullbrite on the character, updateworld to make animation work, then turn fullbright back on before rendering the world...that might get your GFX card to calculate the surface normals correctly for cubemapping to work.


gotelin(Posted 2004) [#35]
Nothing. Is the same, buaaaaaaaa!!!!


MSW(Posted 2004) [#36]
Gotelin - I downloaded Psonic's dwarf model( available here: http://www.psionic3d.co.uk/packs/dwarf/dwarf.html ) ... I unzipped it into the same directory with the normalmapping demo ... it comes with a .BB source program to view the model, so I loaded that into Blitz3D ... I then added this code to it right before the main loop:

;cubemap for normals
nmap=LoadTexture( "cube2.png",1+128 )
SetCubeMode nmap,2
TextureBlend nmap,2

;cubemap for lightcolor
lmap=LoadTexture( "lcube.png",1+128 )
SetCubeMode lmap,2
TextureBlend lmap,5


dudebump = LoadTexture("rockbump.bmp")
TextureBlend dudebump,4
ScaleTexture dudebump,.25,.25

dudeskin = LoadTexture("dwarf2.jpg")
TextureBlend dudeskin,5

EntityFX dude,1

EntityTexture dude,nmap,0,0
EntityTexture dude,dudebump,0,1
EntityTexture dude,lmap,0,2
EntityTexture dude,dudeskin,0,3


fired it up and this is what I got:



It clearly seems to be working fine on my PC...So I dunno what the problem could be?


Mustang(Posted 2004) [#37]
so instead I'm working on a system that subdivdes the maps into zones or sectors...sort of how the Duke3D build engine had sectors, but here each has thier own set of cubemaps...every chacter in the same sector uses the same cubemaps...and when characters move to locations withing the same sector, the same cubemaps are used


That was my conclusion too, using rigid cubes and zones... I never even thought of doing cubes for every character but to make them as a part of the level. You don't even have to use rigid array, you can create points where they are need, iel more densely where you have a change of lightng border etc... then just check runtime which point (and associated cubemap) is the closest one and use that for the moving object. It might pop a little bit but tweening cubemaps is too slow IMO.


gotelin(Posted 2004) [#38]
OK, thanks
Is ok, but the light change with the mouse.
is possible a static light in the model?

Thanks


MSW(Posted 2004) [#39]

That was my conclusion too, using rigid cubes and zones... I never even thought of doing cubes for every character but to make them as a part of the level. You don't even have to use rigid array, you can create points where they are need, iel more densely where you have a change of lightng border etc... then just check runtime which point (and associated cubemap) is the closest one and use that for the moving object. It might pop a little bit but tweening cubemaps is too slow IMO.



Yeah, like an oct-tree...But as I only have one character moveing at a time, tweening cubemaps shouldn't be too slow (only a total of 48 pixels for both cubemaps would need to change...fewer pixels then in an 8 by 8 .BMP)...so it's worth at least a try :P


OK, thanks
Is ok, but the light change with the mouse.
is possible a static light in the model?

Thanks



make sure the animated mesh is rendered fullbright....also in that dwarf thingy, I turned off the mirror as it was causeing some problems when the camera got too close to it.

The cubemaps don't rotate with the model, they are axis bound to the world...you can rotate the model, animated or not, in any direction and the lighting will appear consistant as if useing hardware lighting...so static lighting = most definetely :)


.rIKmAN.(Posted 2004) [#40]
Works great here, though I`m gonna have to re-read this thread a few times to get my head around whats goin on :)

Good work!


.rIKmAN.(Posted 2004) [#41]
Anyone played with this and made anything, I`m intrigued... :)


jfk EO-11110(Posted 2004) [#42]
thanks a lot for sharing!


MSW(Posted 2004) [#43]

Anyone played with this and made anything, I`m intrigued... :)



yeah...well, sort of...more or less trying out new things on non-animated meshes (tis how I "discovered" this technique)

this is my older starfighter model (from the contest a few weeks back)...has a 512 by 512 normal "bump" map, a 256 by 256 skin, a 128 by 128 "glow" map, and a 512 by 512 specular highlight map...along with the two cubemaps (one for normals, the other for light coloring)...as well as a third cubemap (greyscale version of the light coloring map, setcubemode 1) that works with the specular highlight map...

Yeap...this is pure Blitz3D:



done in one pass useing the same code as above (but with the landscape removed)...the original model was given a meshsmoothing in Ultimate Unwrap, accounting for the screwy texturemaping in some areas...so the model is about 1200 polygons...additionaly the specular highlights are real easy to do, but potentialy performance costly...

To do them I just did a copymesh on the ship model...parented it to the shipentity...set it to additive blend...textured it with the specular highlight cubemap (greyscale version of the lightcolor cubemap) in layer zero...and on layer 1 it recieved the specular highlight "mask" (as seen here, I just used the greyscale bump map used to generate the normal map)...what is pretty cool about this is you can control it easily (entitycolor, entityalpha, entityfade, etc) also you could use a spheremap instead, or even just light the mesh with a hardware light parented to the camera to get that "sperical highlights traveling with the camera" effect.

Now the window effect on the star fighter, well that is quite cool...and very easy to do...the pic doesn't do it justice as the windows are completely black when viewed from the lighted side...but from the shaded side they seem to glow green...this was easy in that it's all done through the normal map, basicly inverting the RGB colors for that section of the map...then when DOT3 combined with the cubemaped normales...when in "light" the windows are black...but in shadow when everything else is dark, that section is light...the green color actualy comes from the skin :)


jfk EO-11110(Posted 2004) [#44]
of course, very simple stuff x_x . This is all real cool, I saved it and I hope I'll be able to implement this in a game engine soon. Do you think this makes things much slower, or can modern cards take it without to become much slower?


EOF(Posted 2004) [#45]
Red,
I have a 9200 (Mobility) here. I had same problems as you.
After removing the cubic environment flag (128) from the LoadTexture commands the models show up.
Sadly the results are nothing like the screenshot.

Modifications:
;cubemap for normals
nmap=LoadTexture( "cube2.png",1) ; << 128 removed
SetCubeMode nmap,2
TextureBlend nmap,2

;cubemap for lightcolor
lmap=LoadTexture( "lcube.png",1) ; << 128 removed
SetCubeMode lmap,2
TextureBlend lmap,2



*** EDIT ***

adding 256 (store texture in vram) does the trick for me:

;cubemap for normals
nmap=LoadTexture( "cube2.png",1+128+256)
SetCubeMode nmap,2
TextureBlend nmap,2

;cubemap for lightcolor
lmap=LoadTexture( "lcube.png",1+128+256)
SetCubeMode lmap,2
TextureBlend lmap,2




Red Ocktober(Posted 2004) [#46]
thx JimB...

out of curiosity, lemme try that and see what happens...

[added]
works just as you said it would... hey, what made you look in this direction for the fix???

--Mike


EOF(Posted 2004) [#47]
Just trial and error. Stange how it works with vram eh(?)
I though the card would not support 4*textures per mesh at first. Commenting out a couple of EntityTexture commands got the demo working (without vram flag) but the fancy normal-mapping effects were out.


maximo(Posted 2006) [#48]
WOW


skyfire1(Posted 2006) [#49]
i don't know where my post went but can someone give the media files for this?


Mustang(Posted 2006) [#50]
I might have it at home somewhere... have to check. If you haven't noticed, this over year old thread! :) If I found the stuff, I'll post a linky.


Ruz(Posted 2006) [#51]
I would n't mind tying this too.


jhocking(Posted 2006) [#52]
http://s61.yousendit.com/d.aspx?id=1D9IG8XVQX3NJ08K9QL6032KRG


skyfire1(Posted 2006) [#53]
thanks jhocking, you're the man.


Ruz(Posted 2006) [#54]
cheers jhocking, you are the dude


Mustang(Posted 2006) [#55]
Cool, now I don't have to try to find it. :)

Might also refresh my memory and see what was this all about.


Braincell(Posted 2006) [#56]
arghhhhhhh

i posted the link even before

http://www.johnmanyverse.net/blitz/blitz3dnormalmaps.zip

It contains 4 different demos for normal maps, not just the one in this thread. It has an even better normal map demo with the Athene model.


skyfire1(Posted 2006) [#57]
these are cool! i'm glad that i kept blitz3d.


jhocking(Posted 2006) [#58]
woah Woah WOAH

You almost got rid of Blitz?! You're mad!


skyfire1(Posted 2006) [#59]
hey, i thought that it couldn't do jack.


Ross C(Posted 2006) [#60]
Thanks for the links guys :o)


humanspacecraft(Posted 2006) [#61]
Hello Guys,
is there anybody who has a valid link to this normaldemo(including the cubemap). The links here are not working anymore
...
Thanks


stayne(Posted 2006) [#62]
I wouldn't worry myself too much with it, none of these screenshots look all that impressive. I've seen the dragon demo before and I'm really not seeing any decent normal mapping going on.

Maybe it's just because I hate normal mapping and hope it dies a horrible death soon. It's just too much work and not that impressive.


humanspacecraft(Posted 2006) [#63]
I think it depends on the map. if you have some proper tools then it looks great. like the athene-model...
So iŽam especially interested to know how this cubemap was created.(And still looking for a valid link)


jfk EO-11110(Posted 2006) [#64]
Yeah, I'm a bit bored of this hype too. Wasn't this also used in the doom 3 wet shiny surfaces effect? At least there's it's implemented properly.

I'd rather like to see a true displacement map that will actually bump the texels out of the triangle shape. Not sure if this is possible with todays cards, seen it as a feature of a modeller some time ago.


stayne(Posted 2006) [#65]
Hehe yep, the shiny look. Hate it.

Sorry humanspacecraft, no idea where the athene link is. Andreyman's shadow lib does a good job with it.

http://andreyman.nm.ru/


Kryzon(Posted 2006) [#66]
I've just uploaded the athene example:

http://www.geocities.com/rafanavega_games/AtheneNormalMap.zip

It'll be there to download forever, so, take your time to download it ;)

Cya.


humanspacecraft(Posted 2006) [#67]
Oh,thats very nice but i was looking for a link to the animated normal demo from this thread.Because of its method to color the underlying vertices via a cube map. :( But anyway other people would like to have it...


Ruz(Posted 2006) [#68]
well i tried this a while ago with a head i made and the effect wasn't too hot tbh


humanspacecraft(Posted 2006) [#69]
The above link "http://www.skinnybobthejester.com/" seems not to work...


boomboom(Posted 2007) [#70]
Hey Guys, can someone post this up again?


Kryzon(Posted 2007) [#71]
Humanspacecraft, the link below Ruz's post is his signature to probably his homepage link, it does not have anything to do with the topic content.


jfk EO-11110(Posted 2007) [#72]
Actually, the athene demo works well. What tools are used to create the normalmap, polygon-reduce the original mesh and UVmap the reduced mesh for the normalmap? (A little late, I know :.)


Kryzon(Posted 2007) [#73]
Actually I don't think he used a polygon reduction tool. Rather used a blocking mesh while he was modelling - just after setting up the most basic - but useful - mesh he would start working from. From then on, he just added highres detail and modelled the final version to extract the normal map.