Material parameter

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
715
Looking in the manual it mentions how quiet a few graphical instructions has a material parameter.

DrawLine : Void ( x0:Float, y0:Float, x1:Float, y1:Float, material:Material=Null )
DrawRect : Void ( x:Float, y:Float, width:Float, height:Float, material:Material=Null )

I wonder how do you use material on day a line or rectangle? It sounds exciting but how and what can you do with the material parameter?
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,042
Materials contain shader parameters that map to shader uniforms variables when rendering. Including textures.

These mojo2 examples
  1. shadereffect
  2. drawprimitives2
  3. bumptest

give good examples how to use materials.
 

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
715
Thanks, gonna check out those closer.

Okay I've seen DrawPrimitives but I never connected the fact that material is pretty much the actual texture.
 
Top Bottom