Map Channel / Texturing in Ogre

ncazanav

26-02-2006 21:10:34

Congratulations for oFusion, very useful tool!

Two little questions :

1- it seems impossible to apply a texture material (i am using a standard 3ds material with a texture bitmap on the diffuse slot) to an object which has a map channel different from 1. Is it a bug?

2- I followed the normal mapping tutorial and if I finished it successfully, i must admit that i didn't understand what i was doing. The process of normal mapping seems to me much more complicated than the one in 3dsmax. In fact, texturing in Ogre appears to be a very different process from the one i am used to in 3dsmax. I am currently reading the manual about the script of materials, but many concepts are unclear (vertex shader, pixel shader and the parameters chosen in the tutorial). I have search the wiki for some help on the subject, nothing found... Is there a tutorial or some docs on the subject?

Lioric

27-02-2006 16:32:01

1 Its not a bug, as the object (mesh) is compiled to an optimized mesh for interactive applications.
It will take (and waste) more video memory if the object texture uses a different map channel and the channel 1 is not used.
But you can manually set the channel used for your texture: upgrade your material to an Ogre Material, evaluate it, in the TextureUnit material created set the map channel to what you need

2 The material/texturing process in Ogre (and in any interactive 3d engine) is a little different from the normally used in modeler applications, but not that much when you understand the key concepts of those differences. The main concept you must know is that while in modeler applications the material is concerned to the shading part (what color of every pixel in the object should be draw to screen) in interactive 3d engines, the material manages the shading part and the state of the graphics card[\b], or can give you total control over the graphics chip on your machine so you can put directly in you video card the instructions that the chip will make when processing the object geometry or shading a pixel (the vertex and pixel shaders) and overriding the default behavior that your graphics chip have

The tutorial was made to familiarize yourself with the material process, not to specify the method of Normal Mapping, in fact there are several methods of Normal/Bump Mapping, some can be made in a single pass and requires just the diffuse and normal textures

The parameters passed to the shader programs are needed so they can process the vertex or the pixel in the proper context (the shader pipelines works on a single vertex or a single pixel at time), for example what camera is used, what light is currently processed, the matrix used to convert the vertices between spaces (so they are correctly positionated in the screen). This parameters depends on the shader used or how you created the shader, consider a command line application that needs parameters passed when calling it so the application knows what to process

There are plenty of documentation about render states and shader programs on the net, understand them and you will see the power of directly controling the graphics card

I will post later a few links to game developing tutorials where you can see more on this topics, but bear in mind that you need to understand just the concepts

ncazanav

27-02-2006 21:09:54

Thanks for the info, I am looking forward to reading your links...

ncazanav

27-02-2006 21:10:14

Thanks for the info, I am looking forward to reading your links...