PDA

View Full Version : Trouble with shaders...



scarletsnake
15-06-2007, 08:12 AM
Well, I'm developing quite an advanced game and I'm ashamed to say that I cant load a bump map on a character which has a normal map applied to it. Any help would be appreciated.

As for the game's details; I'll post them later when the bump mappings are in place. :)

JSoftware
15-06-2007, 04:11 PM
Can you supply a bit more information? Are you unable to load the normal map/bump map? Don't you have a shader? Don't you know how to calculate tangentspace normals?

scarletsnake
15-06-2007, 08:23 PM
Right. Sorry. So I have this GLActor, and he has a texture loaded to him directly from the interface, not from the code. My question really is about multitexturing, I think. I found the demo provided poor. I want the glactor to have both textures, like in modern games, the normal texture and the bump-mapping. So in short I dont know how to load the normal texture and the bump map at the same model.Sorry, but I'm not that good with shaders so I cant provide any more information regarding the subject, and I hope this info was sufficent? :( Please do help me.

Robert Kosek
15-06-2007, 08:35 PM
I hate to tell you, but you cannot (should not) combine bump mapping with normal mapping on the same surface. That's a complete waste of processing power. Normal maps are by far superior to bump maps if you can get them, otherwise bump maps can be your fallback option. But of course you cannot apply both.

Or do you mean a "skin"? Don't call a standard image a "normal map" because it is not and you'll just confuse us. ;) And bumpmapping models is really rare, the standard procedure is to use a normal map.

scarletsnake
15-06-2007, 08:47 PM
Nah, I really did have a normal map applied to it, didnt create it myself(just a test) and I read it on some forums that they were actually using that method but anyway, I'll go with the standard routine, can you explain how I'll manage that?

RE Edit; I was using the normal mapping in 3ds max, not in glscene.

Robert Kosek
15-06-2007, 09:12 PM
So you have a base skin plus a normal map. Well, I'm not really good at 3D programming and this is pretty complex. These links may help you get started, otherwise I'll have to defer to others here more into 3D stuff. These are OpenGL tutorials too, so they should work with GLScene, etc.

http://www.delphi3d.net/articles/viewarticle.php?article=bumpmapping.htm
http://www.sulaco.co.za/opengl.htm

scarletsnake
15-06-2007, 09:21 PM
Thanks a lot. I'll look into them. This here looks very advanced, but itll give the main idea of what im trying to do: http://www.satoworks.com/MasterClass/NormalMap.jpg (with the normal map)

www.satoworks.com/masterclasspage.html

how can I do things like these?

its a master class tutorial for facial bones but has shaders as well...

Just want to have the character details like in current generation games , is that hard to do, cause Im gonna skin from scratch and I want to do it right this time.
Much appreciated already, thanks.

Robert Kosek
15-06-2007, 09:51 PM
Yeah, that is very hard to do. For one thing those guys used Maya which is an existing package, therefore all deformation are handled by Maya itself and not them. In fact basically the only thing they actually did was design the head, normal map and skin it, and then bone it so that it could deform correctly like that. Putting something that complex into an actual game is very difficult.

My suggestion is to start with the basics. GLScene uses bones and might have normal map support, if not the tutorials and pages I showed you will do a good bit of explanation and demonstration on how to do normal mapping.

No offense, but is this your first real attempt at programming, or at least game programming? If so you should probably aim a little lower at something a bit more achievable so as to prevent vaporware (IE, a project that is never completed or released).

scarletsnake
15-06-2007, 10:16 PM
Nope, not my first try at programming or game programming, but it is my first go at shaders and materials, as i've never given a straight go at them(i was kind of scared of shaders :) )... I've done some good projects with glscene in the past to experiment, and ive almost got most of the ins-outs except for the shaders.I was always programming little games that had simpler graphics, like indie competiton games(and did join competitons of microsoft's turkish programming competitions but due to the "gore and violence" in my games, i only made it to the finals...), and now im going at some more serious stuff, but it appears that shaders were "a bridge too far" for me, at least for now... Thank you for your time and effort.

scarletsnake
15-06-2007, 10:20 PM
Oh, and yeah, I was aware that it was in Maya. Just wondered if it was possible in GLScene without a serious workout.

Almindor
16-06-2007, 04:49 PM
If you aim for advanced stuff, then use the GLSL custom shaders. There are as of late GLScene some fixed ones translated, so you should be able to get their GLSL code and combine it. GLSL isn't all that difficult (2 days of proper study and you should be able to do some stuff in it) and it provides a truly flexible solution.

So I'd advise for you to remove all the fixed-pipeline shaders, and make a custom GLSL shader code. This way you will do the texturing + bump + normal + other mapping yourself and you can also do easy switching and other nifty stuff. It's a bit jump at start but once you get it up and running it's almost fun.

Just make sure your card has at least 1.5GL support :)

savage
16-06-2007, 07:30 PM
Wow that video http://www.satoworks.com/MasterClass/faceAnimPlayBlust02.mpg is impressive.

Isn't this the sort of system that Half Life 2 uses for their facial animations?

What would be handy is if Maya or other 3D packages could export the shaders that they use to get their effects.

scarletsnake
18-06-2007, 08:40 PM
If you aim for advanced stuff, then use the GLSL custom shaders. There are as of late GLScene some fixed ones translated, so you should be able to get their GLSL code and combine it. GLSL isn't all that difficult (2 days of proper study and you should be able to do some stuff in it) and it provides a truly flexible solution.

So I'd advise for you to remove all the fixed-pipeline shaders, and make a custom GLSL shader code. This way you will do the texturing + bump + normal + other mapping yourself and you can also do easy switching and other nifty stuff. It's a bit jump at start but once you get it up and running it's almost fun.

Just make sure your card has at least 1.5GL support :)

Thanks man. I'll start working on it straight away :) .