nomal mapping, parallax mapping & specular mapping.

Paulov

30-05-2007 23:04:34

Hell.o

I´ve started to play again with normal mapping, now using the monster shaders.

I would like to finally be able to have

1) normal mapping
2)parallx mapping
3) specular mapping

alone, combined, lightmaped... or whaterver.

I´ve started with normal mapping, as I´ve not even the slightliest ide of how to perform the other 2.


----forget this for the moment--------------------------------------------------
And I´m as unhappy with the ressult as I was with the ones I got using the examples in oFusion page.

Here the first shot, well, it looks quite ok, and at the first moment I said myself. "it works!".
www.ikernor.com/download/ogre-forum/ofu ... ster-1.jpg

In this shot, you can see that some of hte normal mapped areas look really good, this asphalt looks quite nice.
www.ikernor.com/download/ogre-forum/ofu ... ster-2.jpg

well, I´ve made a video that perfeclty ilustrates how this shaders keep on degradatig as UVW map tile is increased.
www.ikernor.com/download/ogre-forum/ofu ... g/monster- test-1/normals-monster-1.avi
-----------------------------------------------------------------------

I´ve been able to correct the error, the fail whas that using UVW mapping is not allowed by the shader and you´ve to do this by using the shader parameters, In this case the scale. (very anoying, specially if using a mapping tool like I do).

here the working normal map

www.ikernor.com/download/ogre-forum/ofu ... work-1.jpg

www.ikernor.com/download/ogre-forum/ofu ... g/monster- test-1/monster-2-semiwork-2.jpg
dont know in this last shot why this dark area is generated, Its an error.

I´ve put a car and activated shadows. looks ok.
www.ikernor.com/download/ogre-forum/ofu ... work-3.jpg

www.ikernor.com/download/ogre-forum/ofu ... work-4.jpg

I´ve lightmapped the car and the things go wrong, the shadows looks weird, as shown in the img. I´ve restartd the scene from 0 but as fast I insert that model things go worng.. puaj.. again problems!!!
www.ikernor.com/download/ogre-forum/ofu ... work-5.jpg

www.ikernor.com/download/ogre-forum/ofu ... work-6.jpg


why is that difficult!!! this should be as easy as loading the diffuse and the normal map and go!!!

I feel like using a super beta engine.. I spend a lot of time in tests... in things that should be don in a blink of an eye... :cry:

Lioric

31-05-2007 22:17:20

Shaders are not "general solution" tools, they are very specialized tools

You cant use a shader and hope it will work on any and all situations

The power of the programable pipeline is that you can specialize a specific stage to produce the results you need, and because you have the power to customize any part of the rendering, most (all) shaders are made to produce the needed result and not more, for example if a shader author needed a good normal mapping for planar objects, then dont expect this shader to work on spherical coords

You are using the monster shader, this version was made to support 3 lights at all times, not any other number of lights, and you are using it with a single light (the number of lights can changed in the shader code using defines)

The results you are experiencing with shaders, is not because the engine is in a beta-like state, but because you try to use a shader as a general purpose solution, and they are not

Any engine will behave similar in this case

Probably in the sphere you have more texture channels, and the shader expect a specific number of channels with the specifc information on them

If dont want to work on the specifcs of shaders, and simply use them, then apply the shader that works best on planar objects and use another that works better on other type of objects you need, i wont affect the performance (and in most cases the performance will increase as you specialize the pipeline for each case)

Evak

01-06-2007 01:25:33

The monster shader will works quite well as a general purpose shader. If you want to set your UV's in 3dsmax then set the shaders scaling to 1. That way you can use your uvwmap or unwrap modifier as you would normaly and there will be no tiling done in the shader.

I recall that the monster shader was originaly developed for speed over accuracy, as long as your lights do not get too close to the meshes the results are pretty good.

There are some parameters you can change for monster using your favourite text editor, these are not all avaliable from inside ofusion, and you will have to make different monster shaders with different names for the features you want to use.

Like Lioric says, shaders are very specialised, and don't allow you to adjust your materials the way you are used to in 3dsmax. I'm not able to do too much with shaders myself due to a lack of coding skills. Something that you pretty much have to learn, even if you just want to port existing shaders to Ogre.

There are a couple of tools to make this easier, the rendermonkey exporter, which is still more programmer friendly than artist. Also FXogretool can convert some shaders to ogres material format.

To use them in Ofusion there are extra steps required for ofusion to recognise them in the material editor, and these require some technical coding skills too.

ShaderFX is a nice 3dsmax plugin for making general purpose shaders in 3dsmax, and it's quite artist friendly, it only supports .FX shaders for D3D, and you will still need to modify most of them to work with ogre. There has been some talk about making it more accessible to ogre users. But it isn't cheap at $250.

So at the end of the day, there is no easy way to do shaders, you can decide what ones you want and hire a programmer to make them for you. Or spend several months learning how to code them yourself. (something I plan to start when I can get the time).

In the Monster shader source, these are the settings you can adjust in the monster.source file. You will have to make seperate shaders if you want to have a variety of settings to choose from in your materials.

#define FADING 0
//fading is buggy, experimental guarantees :)

#define ATTENUATION 0

#define LIGHT0_IS_DIRECTIONAL 0
//if u have directional light (suppose a healthy 1 only), it is always light0
//(regarding that you turn off lights in RECOMMENDED ORDER of 2,1,0)
//so do not attenuate it, but then we have power to attenuate light1, and light2
//even with offset mapping on !

#define ANY_TEXTURE 1
#define DIFFUSE_TEXTURE 1

#define AT_LEAST_PERPIXEL 1
#define AT_LEAST_NORMAL_MAPPING 1
#define OFFSET_MAPPING 1

#define AMBIENT 1
#define DIFFUSE 1
#define SPECULAR 1

#define LIGHT0 1
#define LIGHT1 0
#define LIGHT2 0


0=off 1=on

Paulov

01-06-2007 17:42:06

hey-

the shader is working per- feckt -ly

the ressult is brilliant.

Now the specular lits in the direction of the light, without strange curvy shapes etc...

I can only show pics because when trying to capture video Max crashes and I´m unable to export it....

When I export the scene, the shader checkbox is unchecable... disabled for CE users maybe?¿?. hope no...


shots ( in realtime looks better)

www.ikernor.com/download/ogre-forum/ofu ... ter2-5.jpg
www.ikernor.com/download/ogre-forum/ofu ... ter2-4.jpg
www.ikernor.com/download/ogre-forum/ofu ... ter2-3.jpg
www.ikernor.com/download/ogre-forum/ofu ... ter2-2.jpg
www.ikernor.com/download/ogre-forum/ofu ... ter2-1.jpg

www.ikernor.com/download/ogre-forum/ofu ... ter2-6.jpg
---------------------------------------------------------------

Haunted Celica,

Well, this objet is quite ****** since it is really cool but is problematic.
When using the meshupdater it whas the only .mesh that gave problems

And now when aplying a gray material created from scratch, when aplying the lightmap and modigying the channel, all the scene goes crazy but with the channel in "0" value.

In the shots, the box in the top of the shaded plane, has lightmaps and nothing hapens when modigying the channel value. It remember me that strange scene of the donut that when deleting it changed the shaders appearance.....

strange things.

Even stranger when this particular model is the same used by ofussion in their examples, the only that changes is the original texture that is now unused.

--------------------------------------------------------------------------------

Hey EVAK, the shader you passed me is freely distributable?¿ if yes I can distribute the scene so that every artist does not need to suffer what I´ve past, and can simply add hist textures and have a shaded surface working.

--------------------------------------------------------------------------------

--I´m the only one here that hates that 3 color axis?¿ what is that supossed tu be usefull?--- at leas the option for disabling it would be

Evak

01-06-2007 19:48:19

Yeah, that monster shader was originaly in the Ogre wiki but the link is broken. I just have a copy on my web server. But it was intended to be free courtesy of Guilderstein from the Main Ogre forum.

In ofusion pro you can turn the helper objects off which hides the 3 color axes model, not sure if its the same in CE.

Paulov

10-06-2007 16:10:58

I´ve made a video, of that scene.

video
www.ikernor.com/download/ogre-forum/ofu ... ter1.0.avi


///////////////////////////
I see that monster 2.0 has changed the way of modifying the shader. I have not had enough time to play with it, but I find it harder to make it work, as just by loading textures in texture units cells I get nothing.. and not I cant edit the parameters from max...
I someone manages it to work a small text tutorial would be apreciated. or a demos scene or similar.
///////////////////////////

Lioric

12-06-2007 19:21:16

Is there any specific player for your video?, the codec is XviD but its not playable here

Paulov

12-06-2007 20:51:31

Is there any specific player for your video?, the codec is XviD but its not playable here

Ive downloaded it and works fine here, but Ive tested with media player and is true that crashes.

I use BSplayer.
Works with classic media player too.

Next time Ill export to MPEG4 or divx.

Evak

12-06-2007 21:20:51

VideoLAN works and I recommend it highly as it plays quite a few obscure formats out of the box, as well as being cross platform.