particlematerial.monkey2 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. Namespace mojo3d
  2. #rem monkeydoc The ParticleMaterial class.
  3. #end
  4. Class ParticleMaterial Extends Material
  5. #rem monkeydoc Creates a new particle material.
  6. #end
  7. Method New()
  8. ShaderName="materials/particle"
  9. AttribMask=1|8|32
  10. BlendMode=BlendMode.Additive
  11. CullMode=CullMode.None
  12. ColorTexture=Texture.ColorTexture( Color.White )
  13. ColorFactor=Color.White
  14. Gravity=New Vec3f( 0,-9.81,0 )
  15. Duration=10.0
  16. Fade=0.0
  17. End
  18. Method New( material:ParticleMaterial )
  19. Super.New( material )
  20. End
  21. #rem monkeydoc Creates a copy of the particle material.
  22. #end
  23. Method Copy:ParticleMaterial() Override
  24. Return New ParticleMaterial( Self )
  25. End
  26. Property ColorTexture:Texture()
  27. Return Uniforms.GetTexture( "ColorTexture" )
  28. Setter( texture:Texture )
  29. Uniforms.SetTexture( "ColorTexture",texture )
  30. End
  31. Property ColorFactor:Color()
  32. Return Uniforms.GetColor( "ColorFactor" )
  33. Setter( color:Color )
  34. Uniforms.SetColor( "ColorFactor",color )
  35. End
  36. Property Gravity:Vec3f()
  37. Return Uniforms.GetVec3f( "Gravity" )
  38. Setter( gravity:Vec3f )
  39. Uniforms.SetVec3f( "Gravity",gravity )
  40. End
  41. Property Duration:Float()
  42. Return _duration
  43. Setter( duration:Float )
  44. Uniforms.SetFloat( "Duration",duration )
  45. _duration=duration
  46. End
  47. Property Fade:Float ()
  48. Return Uniforms.GetFloat( "Fade" )
  49. Setter( fade:Float )
  50. Uniforms.SetFloat( "Fade",fade )
  51. End
  52. Private
  53. Field _duration:Float
  54. End