I have used 1D texture mapping for ages to render color by depth. This works nicely for lines and points. But when enabling MSAA, the points disappear. The lines are still drawing.
I’ve searched the internet, and I’ve stripped down my application to a bear minimum, played with toggling smoothing on/off, played with blendfunc, shade model… But now I’m running out of ideas. This is old school OpenGL, no shaders.
Here I’m uploading the texture
Gl.glGenTextures(1, out id);
Gl.glBindTexture(Gl.GL_TEXTURE_1D, id);
Gl.glTexParameteri( Gl.GL_TEXTURE_1D , Gl.GL_TEXTURE_WRAP_S , Gl.GL_CLAMP_TO_EDGE );
Gl.glTexImage1D(Gl.GL_TEXTURE_1D, 0, 4, texture1dpixels.Length, 0, Gl.GL_RGBA, Gl.GL_UNSIGNED_BYTE, texture1dpixels);
Then I do this at every frame
Gl.glPushAttrib(Gl.GL_ENABLE_BIT | Gl.GL_TEXTURE_BIT );
Gl.glEnable(Gl.GL_TEXTURE_1D);
Gl.glEnable(Gl.GL_TEXTURE_GEN_S);
Gl.glBindTexture( Gl.GL_TEXTURE_1D , id );
Gl.glTexParameteri(Gl.GL_TEXTURE_1D, Gl.GL_TEXTURE_MIN_FILTER, Gl.GL_LINEAR);
Gl.glTexParameteri(Gl.GL_TEXTURE_1D, Gl.GL_TEXTURE_MAG_FILTER, Gl.GL_LINEAR);
Gl.glTexGeni(Gl.GL_S, Gl.GL_TEXTURE_GEN_MODE, Gl.GL_OBJECT_LINEAR);
double u_per_x = 0;
double u_per_y = 0;
double u_per_z = 1.0/range_cm; //1 texture per per cm
double u0 = (playCenter_z-colorCenter_z) * u_per_z + 0.5; //u at (x,y,z)=(0,0,0) => the current matrix
double[] ps = { u_per_x , u_per_y , u_per_z , u0 };
Gl.glTexGendv(Gl.GL_S, Gl.GL_OBJECT_PLANE, ps);
//drawpoints
//draw lines
It works when just drawing solid points without texture mapping. But before I list more code, I can’t see what could be wrong with this, as it works without MSAA. What am I missing with MSAA?
I couldn’t attach image, so here’s a link to my dropbox