*. material multitexture

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
User avatar
Tyrone
Gnoblar
Posts: 20
Joined: Sun Apr 03, 2005 2:10 am

*. material multitexture

Post 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:
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post 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
			}
		}
	}
}
User avatar
hebdemnobad
Goblin
Posts: 274
Joined: Wed Feb 09, 2005 5:09 pm
Location: catskill escarpment, new york, usa
x 3
Contact:

Post 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:
User avatar
Tyrone
Gnoblar
Posts: 20
Joined: Sun Apr 03, 2005 2:10 am

Post 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??
User avatar
Tyrone
Gnoblar
Posts: 20
Joined: Sun Apr 03, 2005 2:10 am

Post by Tyrone »

The translation is bad either it is logical?
Thank you for your answer
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post 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 ;)
User avatar
Tyrone
Gnoblar
Posts: 20
Joined: Sun Apr 03, 2005 2:10 am

Post 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??
Bill
Gremlin
Posts: 167
Joined: Sun Sep 26, 2004 11:50 pm
Location: Arkansas

Post 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.)
User avatar
Tyrone
Gnoblar
Posts: 20
Joined: Sun Apr 03, 2005 2:10 am

Post 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
User avatar
hebdemnobad
Goblin
Posts: 274
Joined: Wed Feb 09, 2005 5:09 pm
Location: catskill escarpment, new york, usa
x 3
Contact:

Post by hebdemnobad »

it's texture_unit, not Texture_unite...i don't think that ogre would parse Texture_unite correctly

my .0002cents(avossobreslires)
Post Reply