Page 1 of 1

*. material multitexture

Posted: Tue Apr 12, 2005 1:51 pm
by Tyrone
HI,
Can if he{*it*} please you, me given an example of a script *.material for the multi texture. For 2 textures?
That shall be really kind.
Thank you in advance. :wink:

Posted: Tue Apr 12, 2005 5:21 pm
by sinbad
Just repeat the texure_unit {} section, and set colour_op_ex / alpha_op_ex to determine the blending. There are plenty of examples in the distribution, here's one from the very top of Example.material (didn't look very hard, did you? ;))

Code: Select all

material Examples/EnvMappedRustySteel
{
	technique
	{
		pass
		{

			texture_unit
			{
				texture RustySteel.jpg
			}

			texture_unit
			{
				texture spheremap.png
				colour_op_ex add src_texture src_current
				colour_op_multipass_fallback one one
				env_map spherical
			}
		}
	}
}

Posted: Tue Apr 12, 2005 5:57 pm
by hebdemnobad
sinbad is there any way to use three texture unit blends to combine the two texture units in the script above, ie the diffuse texture and the environment map texture, with a traditional 8 bit grayscale bump maps in one or more passes?

i know that emboss maps are not as good looking as normal maps. however i'm working on a web implementation of ogre that will seek to get the most out of older graphics cards, and this means old style gray scale bump maps. viewpoint technology could do it, it would be a shame if those proprietary meanies could one-up ogre on this.

p.s. i've tried to follow your advice in my other thread about finding a specular vertex shader, but it is really beyond my grasp as a content developer and not 3d programmer. :cry:

Posted: Tue Apr 12, 2005 6:50 pm
by Tyrone
I thought more complex it is genial as this.
One last one small question on this subject,
If I puts commands{*orders*} with the embrace of texture_unit esque this one applies in both texture?
I have an example of code here.

Code: Select all

material Ogre/Earring
{
	technique
	{
		pass
		{
			ambient 0.5 0.5 0
			diffuse 1 1 0

			texture_unit
			{
				texture spheremap.png
				colour_op_ex add src_texture src_current
				colour_op_multipass_fallback one one
				env_map spherical
			}
		}
	}
}
The command{*order*} ambient and diffuse applies such in 2 texture in the case or I would have it??

Posted: Wed Apr 13, 2005 2:54 pm
by Tyrone
The translation is bad either it is logical?
Thank you for your answer

Posted: Wed Apr 13, 2005 5:42 pm
by sinbad
Tyrone: I don't understand your question, sorry.

hebdemnobad: You can use as many texture_unit entries as your card allows. If you exceed the limit, the additional units get shunted into another pass using the colour_op_multipass_fallback. I'd recommend ditching the idea of 8-bit greyscale bumps though, emboss mapping really sucks these days ;)

Posted: Wed Apr 13, 2005 9:24 pm
by Tyrone
Made I would like to know if we put the line Ambient 0.5 0.5 0 for example before texture_unit are that it also affects the others texture unites? A small example:

Code: Select all

Material Ogre / Earring 
{ 
   Technique 
   { 
      Pass 
      { 
         Ambient 0.5 0.5 0 
         Diffuse   1    1   0 

         Texture_unit 
         { 
            Spheremap.png texture 
            Colour_op_ex add src_texture src_current 
            Colour_op_multipass_fallback one one 
            Env_map spherical 
        }
         Texture_unite
         { 
          Skin.png texture 
         }
     } 
  } 
} 
Be that my ambient and my diffuse goes affected also skin.pgn or only spheremap.png??

Posted: Wed Apr 13, 2005 10:17 pm
by Bill
Made I would like to know if we put the line Ambient 0.5 0.5 0 for example before texture_unit are that it also affects the others texture unites?
Yes.




Language translators just crack me up. :-) (Language translators make me laugh.)

Posted: Thu Apr 14, 2005 4:16 am
by Tyrone
It is already that lol, has too it is not sad in the other sense.
Thank you for the answer and soon has for new one funny translation :D

Posted: Thu Apr 14, 2005 4:21 am
by hebdemnobad
it's texture_unit, not Texture_unite...i don't think that ogre would parse Texture_unite correctly

my .0002cents(avossobreslires)