- Home /
Question by
codeguyross1 · Sep 07, 2016 at 06:09 PM ·
shaderopenglpoints
Can someone explain to me how to use GL_VERTEX_PROGRAM_POINT_SIZE to make points bigger
I am using the following code to draw points in my scene: The original blog can be found here
public class EnablePointSize : MonoBehaviour
{
const UInt32 GL_VERTEX_PROGRAM_POINT_SIZE = 0x8642;
const UInt32 GL_POINT_SMOOTH = 0x0B10;
const string LibGLPath =
#if UNITY_STANDALONE_WIN
"opengl32.dll";
#elif UNITY_STANDALONE_OSX
"/System/Library/Frameworks/OpenGL.framework/OpenGL";
#elif UNITY_STANDALONE_LINUX
"libGL"; // Untested on Linux, this may not be correct
#else
null; // OpenGL ES platforms don't require this feature
#endif
#if IMPORT_GLENABLE
[DllImport(LibGLPath)]
public static extern void glEnable(UInt32 cap);
private bool mIsOpenGL;
void Start()
{
mIsOpenGL = SystemInfo.graphicsDeviceVersion.Contains("OpenGL");
}
void OnPreRender()
{
if (mIsOpenGL)
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
glEnable(GL_POINT_SMOOTH);
}
#endif
}
The problem is that i don't understand how to use the hex value that is being assigned to GL_VERTEX_PROGRAM_POINT_SIZE to be able to make the points bigger.
I can change the Hex Value and redraw the material but I do not see the change in the size of the points so that means I don't really understand whats going on.
Any insight that could be provided to help with drawing bigger points in the scene would be helpful.
Thanks!
Comment
Your answer