Advertisement

Particle (star) rendering not working.

Started by September 28, 2019 11:37 PM
21 comments, last by Sword7 5 years, 4 months ago

Haven't read all, so this might already have been pointed out, but:

On 9/29/2019 at 7:52 AM, Sword7 said:

glEnable(GL_PROGRAM_POINT_SIZE); glPointSize(1.0);

This looks wrong according to this.

35 minutes ago, _Silence_ said:

Haven't read all, so this might already have been pointed out, but:

This looks wrong according to this.

I already removed glPointSize(1.0) because it is for fixed point size. That is not needed anymore since gl_PointSize is now handled inside shader programs for varying point size. 

1 hour ago, Green_Baron said:

I suspect (but am not sure) that the problem lies elsewhere and may still pop up some time.

In principle, one can create a vertex array and define its vertex attributes before any vertex or element buffer exists and separately from them. When drawing, the array must have a buffer bound to feed the pipeline with data. But the array description and the actual buffer are, to my understanding, separate things. One can leave an array bound (so that the description of the data that is fed into the pipeline stays the same) and switch the buffers associated with that array (Edit: i think that was nonsense; buffers are bound to a target, they are not "associated with an array"). So that for example one buffer is filled by the application while another one is being drawn from. The fact that there is a 1 to 1 relation in all the tutorials between array and buffer is just coincidence. One can even draw without an array and only a vertex buffer bound. It'll be drawn in the order the vertex data comes.

See here for example.

It might be good to keep an eye on it ?️

Oh! I looked my earlier posts and finally realized that I placed them in constructor instead because other init routine messed up my buffer descriptions! I already fixed it by moving them to by glDrawArrays in render routines. 

I am now working on earth orbits around sun. 

This topic is closed to new replies.

Advertisement