point sprites problem

Started by
1 comment, last by Lord_Jekky 14 years, 2 months ago
Since i'm using managed directx, i'm not really sure if i should ask this here or in the .NET forum, so sorry if this is the wrong place. I'm using point sprties to render particles - the trouble is that i can't get them to scale at all. Based on the info i've read in the docs/found on the net, i've set the PointSpriteEnable and PointScaleEnable render states both to true and i've set the PointSizeMin, PointSizeMax and PointSize states to 1, 100 and 50 respectively. I've tried dozens of different values for PointScaleA, PointScaleB and PointScaleC - but no matter what i set, it draws every sprite at the exact size specified by PointSize (or at least that's how it seems) and nothing else regardless of camera distance. So, my questions: 1: Should i have set pointsize at all? 2: did i miss a state somewhere? 3: could the fact that i use a shader for the rendering be causing this problem? 4: should i simply not be using point sprites, is there a better way to get particles?
Advertisement
It's better to make quads as point sprites are notorious for driver issues, one of which you might be experiencing yourself.

You can expand the positions of the corners in a VS if you don't want to do any camera-alignment math on the cpu as you build your list.

There are a variety of ways of doing that, but I tend to pack a code [-1,+1], [+1,+1], [etc] in a texture coordinate in the verts then scale in those directions in camera space. Works nice and gets off the cpu asap
------------------------------Great Little War Game
I suspected that the answer was going to be to drop the point sprites.. they seem to be a lot of trouble to work with.

Thanks for the info, i'll give it a go that way then.

This topic is closed to new replies.

Advertisement