Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

About Particles Instancing and textures

$
0
0

@Alkher wrote:

Hi !

Is it possible to pass a Texture in a VertexDeclaration used to feed instances with the data, to have the particles draw, say... 2 (ore more) different textures ?
Or is Instancing not intended to this ?

The problem is I have thousands of smoke particles, and thousands ember particles, mixing the 2 systems into one would mix them instead of drawing one or another first accoding to the camera's distance, and not correctly overlapping the quads from each system that should effectively overlap.
Smoke is not flat, so do embers, drawing them separately increases the "flatness" feeling.

public struct InstanceData: IVertexType
{
	public static readonly VertexDeclaration VertexDeclaration;
	public Matrix World;
	public Texture2D tex;
	...
	static InstanceData()
	{
		var elements = new VertexElement[]
                {
                	new VertexElement(...
				//Here, is it possible to use the texture "tex" ?
		}
	}
}

EDIT:Just had to look into VertexElementFormat.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles