Results 1 to 2 of 2

Thread: point sprites, help please...

  1. #1
    Member Contributor
    Join Date
    Jun 2013

    Question point sprites, help please...

    hi, i have been struggling with point sprites for a long time here are my vertex and fragment shaders
    Code :
    	const char *fshader =
    	        "#version 430 core\n"
    	        "uniform sampler2D tex1;\n"
    	        "out vec4 color;\n"
    	        "void main(void)\n"
    	        "    color = texture2D(tex1, gl_PointCoord);\n"
    	const char *vshader =
    	        "#version 430 core\n"
    	        "layout (location = 0) in vec4 vertices;\n"
    	        "void main(void)\n"
    		"    gl_PointSize = 60;\n"
    	        "    gl_Position = vertices;\n"
    i set up the texture by loading it with SOIL. then i use glUniform1i to set the sampler2D variable to 1 and then i make the activetexture unit 1 by glActiveTexture(GL_TEXTURE1) and bind the image to it.
    heres my display function
    Code :
    void display ()
    	glClear (GL_COLOR_BUFFER_BIT);
    	glBindVertexArray (vao);
    	glDrawArrays (GL_POINTS, 0, 4);
    thanks much in advance

  2. #2
    Junior Member Newbie
    Join Date
    Nov 2008
    Have a look at the shader at the top of
    Remember to set
    glPointParameterf(GL_POINT_FADE_THRESHOLD_SIZE, point_fade_treshold_size);

Similar Threads

  1. Fix point sprites
    By Alfonse Reinheart in forum OpenGL: General
    Replies: 3
    Last Post: 01-25-2011, 09:14 AM
  2. Point sprites
    By red_gfx in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-04-2009, 11:57 AM
  3. point sprites on ATI
    By Mikkel Gjoel in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 10-18-2006, 07:27 AM
  4. point sprites
    By marksibly in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-06-2006, 10:59 PM
  5. Point Sprites
    By Zeno in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 05-03-2001, 01:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean