Commit Graph

58967 Commits

Author SHA1 Message Date
Maxime Gimeno 0e58dfbd71 Antialiasing fix
- Changed the vec3 color of the fragment shaders by vec4 color with alpha chanel value of 1.

(cherry picked from commit 81477ddd81)
2015-05-04 16:07:50 +02:00
Maxime Gimeno 1cf09a4317 Added GLSL error print 2015-04-30 15:02:06 +02:00
Maxime Gimeno f44c824205 Warning fixed
- Replaced the seond "fit" iterator by "fit2" to avoid conflict
2015-04-27 08:24:19 +02:00
Maxime Gimeno 89348a1ab9 cut_plugin fixed
- replaced the missing modified files by the originals
- added a reference to a vector of floats in traits so that it fills it instead of drawing the bboxes
2015-04-24 15:59:23 +02:00
Maxime Gimeno 85dc68ac9e Forgot to remove my logs again 2015-04-24 11:46:46 +02:00
Maxime Gimeno cef11f0928 Selection improve
I added a vao for handling the selection color change, which is now instant.
2015-04-24 11:46:46 +02:00
Maxime Gimeno 1b11fca614 slow draw of polyhedron_items fixed 2015-04-24 11:46:46 +02:00
Maxime Gimeno fa9ec055a6 little fix 2015-04-24 11:46:45 +02:00
Maxime Gimeno c270b32c24 bbox_item upgraded 2015-04-24 11:46:45 +02:00
Maxime Gimeno c7e8bc22d8 Draw point implementation
I realized I forgot to add a call to contextual_changed in the wiremode and points mode.
2015-04-24 11:46:44 +02:00
Maxime Gimeno a87c87a611 Scene c3t3 item upgrade
I had to implement the clipping myself, appart from that everything went fine.
2015-04-24 11:46:44 +02:00
Maxime Gimeno 7db52de9b5 Edit 2015-04-24 11:46:44 +02:00
Maxime Gimeno e6c6efb86d Selection_item upgrade 2015-04-24 11:46:43 +02:00
Maxime Gimeno 4e363dc6e6 Scene_plane_item upgraded
I added some functions in the .cpp file, that was empty before.
2015-04-24 11:46:43 +02:00
Maxime Gimeno 078ad824ff Polyhedron_transform_item upgrade
It was quite simple, as there was only lines to draw. I add to add a call to change in replaceItem (scene.cpp) though.
2015-04-24 11:46:43 +02:00
Maxime Gimeno 05fe53e652 points_with_normal_item upgrade
A classic approach, except for the splatting, that won't work until the scene class don't call a GLSplat Renderer anymore.
2015-04-24 11:46:42 +02:00
Maxime Gimeno 3a7f25962b points_with_normals upgrade
Splat_draw is missing for now, and I had to add some calls to changed from different files manipulating scene items.
2015-04-24 11:46:42 +02:00
Maxime Gimeno 0c1dca6fa6 Double pointsdrawing fixed
I just found out about renderingMode() == PointsPlusNormal, that solved the problem.
2015-04-24 11:46:41 +02:00
Maxime Gimeno 20a5f19fe6 Points+normals fixed
I don't really understand why it is called points+normals as it never was the normals, but anyway.
The problem is that the points are drawn twice, once with draw and once with draw_edges.
2015-04-24 11:46:41 +02:00
Maxime Gimeno 85e0de731a Convex Decomposition fixed
Just added a call to changed() in the function.
2015-04-24 11:46:41 +02:00
Maxime Gimeno f06493726a Upgraded to OpenGL ES 3.0
No more gluTessPolygon, which means the light does not reveal strange triangles in the surface, but the way nef_Polyhedron deals with the vertices from an OFF file makes a Triangulation mandatory for every polygon, even if it already is triangulated.
2015-04-24 11:46:40 +02:00
Maxime Gimeno 463c3e5b0e Finished
The spheres are implemented, everything seems to work.
2015-04-24 11:46:40 +02:00
Maxime Gimeno 613e990d1f edit_polyhedron update
Spheres option remaining. The 3 axis of the system when editing are now 3 lines (blue, red and green) until I find a way to draw an arrow.
2015-04-24 11:46:39 +02:00
Maxime Gimeno 5137499fff Shader modifications
I moved the texture drawing in the fragment shader, this way the drawing is done by pixel and not by primitive. Forgot about that before I code inimplicit_fuction where it was obvious.
2015-04-24 11:46:39 +02:00
Maxime Gimeno 0d5d776f53 Change of name
I renamed shading_mode_changed to contextual_changed, as I use the function in implicit_function for a different test.
2015-04-24 11:46:39 +02:00
Maxime Gimeno 61ebf2f25a Upgrade and use of a texture
Upgraded to OGL ES 3 and draw the slice in a texture instead of drawing it directly.
2015-04-24 11:46:38 +02:00
Maxime Gimeno a09fda551a Forgot the destructor. 2015-04-24 11:46:38 +02:00
Maxime Gimeno 8c6efa6aae Add changed for polylines. 2015-04-24 11:46:38 +02:00
Maxime Gimeno c08e4b6de5 Some clean-up
Erased some comments.
2015-04-24 11:46:37 +02:00
Maxime Gimeno 6d2e24c4fc Wired Spheres as Quads.
The spheres appears with quads in the wiremode. It was just an implementation of the conversion code from triangles to lines when filling the positions_wire_spheres vector.
2015-04-24 11:46:37 +02:00
Maxime Gimeno 4a48cfb524 Update of polyline_item.
Polylines now use shaders, and spheres are made without gluSphere. The displayList has been replaced bay an Instanced drawing of the shperes with the function DrawArraysInstanced.
2015-04-24 11:46:37 +02:00
Maxime Gimeno 3a945c9e00 textured polyhedron update
The textured polyhedron now use shaders to display an abject and its textures. The draw function doesn't call the Textured_Polyhedron.h function anymore, only to compute the normals.
2015-04-24 11:46:36 +02:00
Maxime Gimeno 22c51dfa66 Soup Item upgrade
Soup Item can now read and draw non-triangle faces polygon soups.
2015-04-24 11:46:36 +02:00
Maxime Gimeno 1f22ca4ca2 Triangulation test updates
The test to know if a polygon is triangulated is now done once per changed() call,
and it iterates the faces until it finds one that is not a triangle.
2015-04-24 11:46:36 +02:00
Maxime Gimeno b5c8876071 Not triangle facets implementation
The polyhedron item is now able to draw plygons with not-triangle facets, but can no longer have a Gouraud Shading model.
2015-04-24 11:46:35 +02:00
Maxime Gimeno 671c350f2c Split the rendering in two programs
Facets and Edges have now each their own program.
I had to change attrib_uniform to get a parameter which precise which program we are using.
 GlUseProgram is now done in attrib_uniform.
2015-04-24 11:46:35 +02:00
Maxime Gimeno 140a6b408a Implementation of draw_points
just added the same function as polygon_soup_item and it works perfectly.
2015-04-24 11:46:35 +02:00
Maxime Gimeno 585e3adb76 Fix bugs, clean code and implement color
I changed a few details in polygon_soup_item, like the sizeof(float) or the size of the location array.

Fixed the bug that deformed an item in polyhedron_item, caused by glGet(GL_POLYGON_MODE) that takes an array of 2 int and not a single int.

Implemented the color changes in polyhedron_item depending of the selection.
2015-04-24 11:46:34 +02:00
Maxime Gimeno 4ca98368fb Cleaning of the code
cleaned-up some VBO binding that was useless and corrected a sizeof error.
2015-04-24 11:46:34 +02:00
Maxime Gimeno cae8bd242c Just to test
the magic cout is at line 326.
2015-04-24 11:46:33 +02:00
Laurent Rineau d20b7d3ce3 Better use of Vertex Array Object
Once the VAO is fully set up, the drawing functions only have to bind it
and unbind it. No need to bind/unbind and setup the VBOs.
2015-04-24 11:46:33 +02:00
Maxime Gimeno 9fd3d43aa2 First upgrade of polyhedron item
Now using a shader to draw. Remaining a strange bug in which gouraud and flat modes are exchanged.
2015-04-24 11:46:33 +02:00
Laurent Rineau 27a5ff51b5 Cleaner drawing code
uniform_attrib() takes the viewer as argument. That way, `mvp_mat` and
`mv_mat` can be local variables of the method.

The two drawing method draw() and draw_points() both take the viewer as
argument, and no longer setup the buffers (they only use them).

Add cleanup code at the end of the drawing methods.

(See ../../../Mesh_3/demo/Mesh_3/Scene_segmented_image_item.cpp for a
very clean OpenGL code.)
2015-04-24 11:46:32 +02:00
Laurent Rineau ecea7c3ef6 Split compile_shaders()
New function initialize_buffers(), that is called in
changed(). compile_shaders() is only call once, in the constructor (but
it should be a static initialization).

glGenBuffers() and others are also called in the constructor.

Add cleanup code at the end of initialize_buffers().
2015-04-24 11:46:32 +02:00
Laurent Rineau e16cca10ef Call compile_shaders() in the constructor
Ideally, the shaders should static variables.
2015-04-24 11:46:31 +02:00
Laurent Rineau 911731eceb Call compute_normals_and_vertices() in changed() 2015-04-24 11:46:31 +02:00
Maxime Gimeno de58fbbc68 Multiple objects rendering fix
The buffers was only bound once at the creation of the object, which means that only the last object created had its buffers right.
2015-04-24 11:46:31 +02:00
Maxime Gimeno 2a667cef90 Points view fix
The size of the data passed to the buffer was too large, noise was passed.
2015-04-24 11:46:30 +02:00
Sébastien Loriot 1fc89d64e4 applicable now depends on the action
(cherry picked from commit b9fbda6c0c)
2015-04-24 11:46:30 +02:00
Maxime Gimeno f9701452e6 Draw Two Side implementation
The shader is now able to "draw two sides".
2015-04-24 11:46:30 +02:00