Jump to content
  • Advertisement
Sign in to follow this  
demiurgeinc

Confused about PointSprites...

This topic is 4834 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to create glowing stars. Right now I have points; here is my VertexFormat:
public struct PointVertex
{
	public Vector4 position;
	public float pointSize;
	public int color;
	public static readonly VertexFormats Format = VertexFormats.Transformed | VertexFormats.Diffuse | VertexFormats.PointSize;
}
And here is my drawing code:
game.device.VertexFormat= PointVertex.Format;		
game.device.SetStreamSource( 0, starfield, 0 );	
game.device.DrawPrimitives( PrimitiveType.PointList, 0, numberOfStars );
Now I know I need to set a bunch of different shit with RenderStates and maybe I need to use an actual texture or something. But, none of the Directx books I have talk about any of this. Is there something out there that describes the meaning of the different states, options, and settings and how to use them together to create different effects? I'm trying to create a simple 2D space game with decent looking graphics. I thought it would be cool to try to get some decent visual effects going in 2d environment. For example one of the things I want to accomplish is a 'hyperspace' effect: where all the stars are going by so fast you see trails (an effect created with lines I'd guess). Maybe someone could help me with these glowing stars, or point me to something that I can gain a real understanding of all this. In either case, I appreciate any help. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Typically speaking where is the best place to setup texture states? Is setting them each frame costly?

Where can I find an in depth explaination of the different TextureState operations and arguments?

Share this post


Link to post
Share on other sites
For that, the best place is probably going to be the DirectX SDK.

As for setting texture stage states per frame: If you render a whole bunch of particles at one time (all sharing the same texture) you can set the texture stage states for that bunch, then render all of them. Its really not too different than rendering regular geometry/models. The more different textures (or rather texture effects) that you use the more often you will have to change texture stage states.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!