I have array of color triangles
After rotate, i have strange artefacts
I think you have to explain a little bit more ... maybe show us you GL initialization (GL.Ortho etc) code ..
I cannot say for sure, but these look like z-artifacts, i.e. there's not enough z-resolution to distinguish which triangle should go in front.
How close together are your triangles? What is your projection matrix?
triangles very close.
size of triangle around 100x100x1 meter
perspective projection (Z) 1...100000
If you have a 16-bit z-buffer it means you have a total of 65536 different possible z values.
With near-far set to 1..100.000 (one hundred thousand) there are approx. 100/65 possible z-values - that is more than one meter between each z value. (Not entirely correct since z-value-spacing is not linearly spaced IIRC - but roughly.)
And with triangles in the size of one meter, the above screenshots is the expected (random) outcome.
Try changing near-far to 1..10 instead.
Yes,after change (near-far) to small value all okey.
What good way for best perfomanse - use glList or VBO?
Display lists tend to be a little faster for static geometry, but it depends on the driver.
On the other hand, VBOs are more future proof (display lists have been deprecated in GL3+).
How can I do it faster?
Part of code to prepeare
...(repeat for every triangle)
And part of code to render scene
public void Draw()
Very slow render for ~10.000 triangles :(
P.S. Also i use GL.Enable(EnableCap.CullFace);
Your code looks fine, how slow is it?
Modern hardware should fly with only 10K triangles (100s if not 1000s of fps). Maybe you are not getting hardware acceleration? What does GL.GetString(StringName.Vendor) return?
Try download and install new drivers pack.
Yes, you are right. Perfomanse significaly grow up. Cool.
And last quest. How can render only front face?
I think about two display list, but it look not very elegant.
Site design by Stefanos A. Icons courtesy of gnome-colors.