GLSL 1.5 and Sending Vertices

Started by
11 comments, last by Mariusz Pilipczuk 10 years, 9 months ago

You should do error checking then to see if something is wrong. And also query the shader for the actual locations so you don't hard code the wrong attribute locations. One thing that just occurred to me now though is that you may have to set the pointer to integer type attributes with glVertexAttribIPointer instead.

Thanks. That solved the problem.

Pretty sure gl_FragColor is deprecated in glsl version 150.

I'm sorry, I tried upvoting your post and accidentally clicked the wrong thing and now i don't know how to reverse it -.-

If gl_FragColor is deprecated, then how do I tell the GPU what color the pixel should be??

Advertisement

Pretty sure gl_FragColor is deprecated in glsl version 150.

I'm sorry, I tried upvoting your post and accidentally clicked the wrong thing and now i don't know how to reverse it -.-

Unfortunately, votes are final immediately. I would definitely like to see some grace period though so silly mistakes like that can be corrected. I'll bump him up a step so the post doesn't show a -1 at least.

If gl_FragColor is deprecated, then how do I tell the GPU what color the pixel should be??

You use custom out variables in the fragment shader, just like the inputs to the vertex shader are custom in variables. The variable on location 0 goes to the primary render target, the variable on location 1 goes to the second render target, and so on. If you're not working with multiple render targets, then just define an out variable in the fragment shader and write to it.

Pretty sure gl_FragColor is deprecated in glsl version 150.

I'm sorry, I tried upvoting your post and accidentally clicked the wrong thing and now i don't know how to reverse it -.-

Unfortunately, votes are final immediately. I would definitely like to see some grace period though so silly mistakes like that can be corrected. I'll bump him up a step so the post doesn't show a -1 at least.

If gl_FragColor is deprecated, then how do I tell the GPU what color the pixel should be??

You use custom out variables in the fragment shader, just like the inputs to the vertex shader are custom in variables. The variable on location 0 goes to the primary render target, the variable on location 1 goes to the second render target, and so on. If you're not working with multiple render targets, then just define an out variable in the fragment shader and write to it.

Aaah, thanks, that makes sense. Thank you to everyone who helped :)

This topic is closed to new replies.

Advertisement