Porting point sprites from DirectX

Started by
1 comment, last by justin12343 11 years, 3 months ago

I've hit a road block in the development of my OpenGL renderer regarding the size of point sprites. I have been writing the features of my renderers for DirectX first and then I immediately port them to OpenGL after I get them working, since Windows is my primary platform and DirectX seems to be easier to write for (come get it haters lol). I noticed that you can't set the point size for each point sprite individually in OpenGL as you can in DirectX (and OpenGLES), unless you use a shader. My readings tell me that I can cheat using the Z value and distance attenuation to achieve the same effect. My question is how do I use this to make my point sprites look exactly the same in OpenGL as they would in DirectX? I trying to avoid taking the shader route for this because I want my engine to be able to run on older hardware.

Advertisement

I trying to avoid taking the shader route for this because I want my engine to be able to run on older hardware.

Not a direct answer to your question, but I'd strongly urge you to reconsider this. The reason why is: it's now 2012, shaders have been available for over a decade, so: older hardware supports shaders too. In fact, point sprites are an OpenGL 2.0 feature, and OpenGL 2.0 includes shader support, so if you have support for point sprites then you also have support for shaders.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

<blockquote class='ipsBlockquote'data-author="mhagain" data-cid="5013381" data-time="1356177245"><p>
<blockquote class='ipsBlockquote'data-author="justin12343" data-cid="5013246" data-time="1356124157"><p><br />
I trying to avoid taking the shader route for this because I want my engine to be able to run on older hardware.</p></blockquote>
Not a direct answer to your question, but I'd strongly urge you to reconsider this. The reason why is: it's now 2012, shaders have been available for over a decade, so: older hardware supports shaders too. In fact, <a href='http://en.wikipedia.org/wiki/OpenGL#OpenGL_2.0'>point sprites are an OpenGL 2.0 feature, and OpenGL 2.0 includes shader support, so if you have support for point sprites then you also have support for shaders</a>.</p></blockquote>

Then I guess I'll be taking the shader route. Thanks for the reply!

This topic is closed to new replies.

Advertisement