Skip to main content

History: -Material

Preview of version: 13

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | 0-9


Material - A material determines how the surface of a {LEX()}mesh{LEX} will appear after being rendered. You can e.g. assign {LEX()}texture{LEX}s, set colours, enable lighting or {LEX()}shadow{LEX}-receiving as well as assigning {LEX()}shader{LEX}s.

Normally it's just visible from one side (e.g. surface of a {LEX()}mesh{LEX}), but this can be changed (e.g. for {LEX()}water{LEX} surfaces). Material properties can be defined by material files or by source code.

Transparency


If you have problems with transparency, look for some important material options.

  • Set scene blend to alpha blend
  • Disable depth write


Depth write can be turned off when rendering static backgrounds or when rendering a collection of transparent objects at the end of a scene so that they overlap each other correctly.

Apply in material script:

Copy to clipboard
material TransparencyExample { technique { pass { //... scene_blend alpha_blend depth_write off } } }



Apply by code (C# example for Mogre):

Copy to clipboard
myMaterialPtr.GetTechnique(0).GetPass(0).SetSceneBlending(SceneBlendType.SBT_TRANSPARENT_ALPHA); myMaterialPtr.GetTechnique(0).GetPass(0).DepthWriteEnabled = false;




See also



Ogre Manual:

History

Information Version
Wed 17 of Jun, 2020 22:19 GMT-0000 sercero 22
Thu 17 of Jul, 2014 12:12 GMT-0000 petersvp Fixed a typo ;] 21
Fri 08 of Feb, 2013 13:10 GMT-0000 spacegaier removed duplicated "See Also" section 20
Sun 31 of Jul, 2011 22:14 GMT-0000 jacmoe 19
Sun 24 of Apr, 2011 12:49 GMT-0000 Beauty added code snippet how to apply material by code 18
Wed 23 of Feb, 2011 13:08 GMT-0000 Beauty added section about both-side visibility 17
Mon 21 of Feb, 2011 10:53 GMT-0000 Beauty tiny change 16
Mon 21 of Feb, 2011 10:51 GMT-0000 Beauty added note for alpha value and transparency 15
Fri 11 of Feb, 2011 13:06 GMT-0000 Beauty added section about transparency 14
Fri 11 of Feb, 2011 13:01 GMT-0000 Beauty added section about transparency 13
Thu 03 of Feb, 2011 15:59 GMT-0000 Beauty added 2 links 12
Wed 08 of Dec, 2010 05:26 GMT-0000 sarcacid cleaned up lexicon links 11
Tue 07 of Dec, 2010 19:30 GMT-0000 Beauty added links to Ogre manual 10
Tue 07 of Dec, 2010 16:13 GMT-0000 Beauty highlight 9
Thu 09 of Sep, 2010 11:50 GMT-0000 Beauty added link 8
Wed 18 of Aug, 2010 15:44 GMT-0000 Beauty added link 7
Wed 18 of Aug, 2010 15:41 GMT-0000 Beauty added link 6
Fri 08 of Jan, 2010 00:06 GMT-0000 jacmoe 5
Thu 07 of Jan, 2010 22:36 GMT-0000 jacmoe 4
Thu 07 of Jan, 2010 22:36 GMT-0000 jacmoe 3
Tue 29 of Dec, 2009 09:40 GMT-0000 jacmoe 2
Sat 28 of Nov, 2009 17:32 GMT-0000 Spacegaier linked to the API 1