Results 1 to 3 of 3

Thread: textured point sprites?

  1. #1
    Member Contributor
    Join Date
    Jun 2013
    Posts
    71

    textured point sprites?

    hi i am reading the opengl programming guide and am trying to display textured point sprites.
    here are my shaders:
    Code :
    const char *fshader =
     
    	        "#version 430 core                                                              \n"
     
    	        "                                                                               \n"
     
    	        "uniform sampler2D tex1;                                                           \n"
     
    	        "uniform sampler2D tex2;							\n"
     
     
    		"                                                                               \n"
     
    	        "out vec4 color;                                                                \n"
     
    	        "                                                                               \n"
     
    	        "void main(void)                                                                \n"
     
    	        "{                                                                              \n"
     
    	        "    color = texture(tex1, gl_PointCoord) + texture(tex2, gl_PointCoord);                   \n"
     
    	        "}                                                                              \n";
     
     
    	const char *vshader =
    	        "#version 430 core                                                              \n"
    	        "layout (location = 0) in vec4 vertices;\n"
    	        "                                                                               \n"
     
    	        "void main(void)                                                                \n"
     
    	        "{                                                                              \n"
     
    	        "                                                                               \n"
     
    	        "    gl_Position = vertices;                                       \n"
    	        "}                                                                              \n";

    i then just simply set the point size using glPointSize(60) load my textures with SOIL and setup my array buffer and draw four points. all i get is one color for all the points. im also binding the textures to the appropriate texture unit. what am i doing wrong?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    3,100
    Quote Originally Posted by sandbucket View Post
    i then just simply set the point size using glPointSize(60) load my textures with SOIL and setup my array buffer and draw four points. all i get is one color for all the points.
    Have you tried glEnable(GL_POINT_SPRITE)? It may be required if you're using a compatibility profile context.

  3. #3
    Member Contributor
    Join Date
    Jun 2013
    Posts
    71
    GL_POINT_SPRITE was removed in 3.2. anybody see anything else wrong with this. ive tried also setting the size in my vertex shader (gl_PointSize) and enabling GL_PROGRAM_POINT_SIZE. does anybody know what i did wrong?

Similar Threads

  1. textured poin sprites example
    By sandbucket in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 09-13-2013, 04:10 PM
  2. Replies: 0
    Last Post: 02-07-2012, 09:39 AM
  3. Point Sprites & AMD
    By Nowhere-01 in forum OpenGL: Drivers
    Replies: 6
    Last Post: 05-31-2011, 09:47 AM
  4. Performance: Textured vs Vector/Drawn Sprites
    By festivusmiracle in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-13-2009, 09:49 PM
  5. textured point sprites using vertex and fragment programs
    By ScottManDeath in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 02-26-2003, 12:06 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