Jump to content
  • Advertisement
Sign in to follow this  
ChristophR

OpenGL glPointSize vs. D3DRS_POINTSIZE in Direct3D

This topic is 4655 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

Hi! I want to write a particle system which runs on OpenGL and Direct3D. But it seems that the two apis calculate with other units. If I set the point size to 1 in Direct3D
device->SetRenderState(D3DRS_POINTSIZE, floatToDWORD(1.0f));
the points are much larger than if I set the point size to 1 in OpenGL:
glPointSize(1);
If have to set it to something around 20 in OpenGL that they have the same size. Therefore I would like to know the exact factor to convert a Direct3D-point size to OpenGL. Or could it be that it has something to do with the attenuation rather than with the point size? If have activated the attenuation of the point size in both apis with the following lines of code:
OpenGL:

float32 attenuation[] =  {1.0f, 0.0f, 0.0f};
glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB, attenuation);
Direct3D:

device->SetRenderState(D3DRS_POINTSCALE_A, floatToDWORD(0.0f));
device->SetRenderState(D3DRS_POINTSCALE_B, floatToDWORD(0.0f));
device->SetRenderState(D3DRS_POINTSCALE_C, floatToDWORD(1.0f));
PS: Excuse me that I have so many questions about OpenGL AND Direct3D, but I try to write my first api-independent graphics engine. I considered if I shall post this question in this or in the Direct3D forum, but I think OpenGL programmers have mostly more experience with Direct3D than the other way round. rgds

Share this post


Link to post
Share on other sites
Advertisement
a point size of 1 should appear 1 pixel wide in opengl
unless u have dist attenuation (which u have)
check the spec or gl + d3d for the attenuation math calculations
grab a piece of paper and input a few numbers and do the math yourslef, in 2 minutes youll understand how attenuation works + then it should be easy to get the same result in oogl + d3d

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!