public void DrawCustomShader( Shader shader, ShaderAction setup, RenderUserData userData, Vector3 Position, Vector2 size, Color4 color, Vector2 topleft, Vector2 topright, Vector2 bottomleft, Vector2 bottomright, float angle, int layer, float z = float.NegativeInfinity ) { currentTexture = null; int vc = vertexCount; CreateBillboard( Position, size, color, angle, topleft, topright, bottomleft, bottomright ); buffer.AddCommand( this, shader, setup, userData, vc, layer, float.IsNegativeInfinity(z) ? RenderHelpers.GetZ(Matrix4.Identity, camera.Position, Position) : z ); }
public void AddCommand(Shader shader, ShaderAction setup, Action <RenderState> cleanup, WorldMatrixHandle world, RenderUserData user, VertexBuffer buffer, PrimitiveTypes primitive, int start, int count, bool transparent, int layer, float z = 0) { if (transparent) { Transparents[transparentCommand++] = new RenderCommand() { Source = shader, ShaderSetup = setup, World = world, UserData = user, Cleanup = cleanup, Buffer = buffer, Start = start, Count = count, Primitive = primitive, CmdType = RenderCmdType.Shader, BaseVertex = -1, SortLayer = transparent ? layer : SortLayers.OPAQUE, Z = z }; } else { throw new InvalidOperationException(); } }
public void AddCommand(Shader shader, ShaderAction setup, Action <RenderState> cleanup, Matrix4 world, Lighting lt, RenderUserData user, VertexBuffer buffer, PrimitiveTypes primitive, int baseVertex, int start, int count, bool transparent, int layer, float z = 0) { if (transparent) { Transparents[transparentCommand++] = new RenderCommand() { Source = shader, ShaderSetup = setup, World = world, UserData = user, Cleanup = cleanup, Buffer = buffer, Lights = lt, Start = start, Count = count, Primitive = primitive, CmdType = RenderCmdType.Shader, SortLayer = transparent ? layer : SortLayers.OPAQUE, Z = z }; } else { Commands[currentCommand++] = new RenderCommand() { Source = shader, ShaderSetup = setup, World = world, UserData = user, Cleanup = cleanup, Buffer = buffer, Lights = lt, Start = start, Count = count, Primitive = primitive, CmdType = RenderCmdType.Shader, SortLayer = transparent ? layer : SortLayers.OPAQUE, Z = z }; } }
public void AddCommand(Billboards billboards, Shader shader, ShaderAction setup, RenderUserData userData, int indexStart, int layer, float z) { Transparents[transparentCommand++] = new RenderCommand() { CmdType = RenderCmdType.BillboardCustom, Source = billboards, ShaderSetup = setup, UserData = userData, Index = indexStart, Cleanup = shader, SortLayer = layer, Z = z }; }
public void AddCommand(Shader shader, ShaderAction setup, Action <RenderContext> cleanup, WorldMatrixHandle world, RenderUserData user, VertexBuffer buffer, PrimitiveTypes primitive, int start, int count, bool transparent, int layer, float z = 0, int renIndex = 0) { if (transparent) { Transparents[transparentCommand++] = new RenderCommand() { Key = RenderCommand.MakeKey(RenderType.Transparent, 0, layer, z, renIndex), Source = shader, ShaderSetup = setup, World = world, UserData = user, Cleanup = cleanup, Buffer = buffer, Start = start, Count = count, Primitive = primitive, CmdType = RenderCmdType.Shader, BaseVertex = -1, }; } else { throw new InvalidOperationException(); } }