* Use GL vertex buffers and index buffers for 3D model rendering
* Use material or average vertex color for bounding boxes instead of red
* Reinstate bounding box rendering with GL vertex/index buffers
* Use compact vertex/index data representation
- 8-bit normals
- 8-bit colors
- 16-bit or 32-bit indices, depending on model size
This should improve performance a bit on lower end GPUs with less memory
and bandwidth.
Fixes#4112
Move the camera out to its own so that everything else is board-
related, and then rename BOARD_ADAPTER.
At some point the flags should probably be moved out too, and they
can have the EDA_3D_SETTINGS name.
Remove holes on Silk layer by default so the behaviour is the same
on OpenGL and Raytracing.
Fixes#1836
Fix raytracing shadow offset issue.
Some codestyle fix.
Rotating to 0 when above pi would result in the board spinning back
through pi to get there. This led to jarring motion.
Also fix an issue added in b6f64815 where the board would rotate
2pi when crossing over the 0-2pi boundary.
* Split up the thirdparty code into the thirdparty folder (#3637)
* Create a new kimath static library containing all the math functions
This is part of cleaning the build system for #1906.
Given that we compare the dot product (square of length) to s_min_dot,
it means that s_min_dot also needs to be square, or we wind up
converting line segments into circles that are visually distinct from
circles, leading to gaps in polylines.
A few files snuck in with CRLF for the line endings. These make it hard
to look at diffs as every line appears to have changed. This commit
makes only line ending changes, so can be ignored
This removes the remaining hard-coded segments counts and replaces them
with the relative error calculation where the segments per arc is
determined by the maximum error we allow (smaller arcs = fewer segments)
Provide a toolkit-agnostic interface for "busy indicators", which
allows the 3D viewer to show a busy cursor, without the canvases
having to to know how a wxCursore works.
The motivation here is to decouple the 3D renderers from the WX
GUI system, as they can then be used when when there is not an
active window (e.g. for offscreen rendering).
Otherwise, attempting to use a wxBusyCursor without a GUI
available is an instant segfault.
The middle layer of the 3d contours does not need threading as it does
not have substantial calculations. It also contains has a few
wx*Asserts that may not be called from other than the main thread.
Rather than remove useful error checking, we remove excess threading.
Fixes: lp:1802940
* https://bugs.launchpad.net/kicad/+bug/1802940
In C3D_RENDER_OGL_LEGACY::setupMaterial(), the struct
m_materials (which is made up of floats and glm::vec3f's)
is initialised with a memset to 0. This is unsafe, as
floating point value representations in C++ are implementation-
defined (so 0 in memory is not 0-valued for sure).
Use empty-brace aggregate-initialisation, which does the right thing.
This commit finishes the removal of OpenMP from the KiCad codebase.
Removed in this commit are the OpenMP calls in 3d-viewer and
qa/polygon_triangulation as well as all references in CMakeLists.txt
std::thread is used instead for multithreaded computation
Replaces Poly2Tri with updated code to process polygons faster and more
robustly. Notably, we can now handle overlapping holes in the polygons,
allowing us to cache the triangulation of complex boards
glFinish is meant to ensure every aspect of the screen is fully-drawn
before continuing. This causes issues with certain chipsets (Intel
4-8k)
glFlush is more of a suggestion that CPU work is complete and the GPU
should complete its work in a "timely" fashion.
We add an additional glFinish call before getting a screenshot as this
will copy the actual data from the card buffer.
Fixes: lp:1775976
* https://bugs.launchpad.net/kicad/+bug/1775976
Initialize module matrices to identity matrices instead of default zero
matrices while creating scenes for raytracer. This fixes disappearing
modules in raytracer view.
Fixes: lp:1763026
* https://bugs.launchpad.net/kicad/+bug/1763026
LAYER_NON_PLATED to LAYER_NON_PLATEDHOLES
LAYER_PADS_HOLES to LAYER_PADS_PLATEDHOLES
LAYER_PADS to LAYER_PADS_TH
and add comments and fix a render issue in gal mode for non plated holes.
- Display offset units in 3D preview window (inches or mm)
- Fix offset in 3D renderer
- Fix offset in Raytracing renderer
- Fix offset in STEP export
- Fix offset in VRML export
- Display offset units in 3D preview window (inches or mm)
- Fix offset in 3D renderer
- Fix offset in Raytracing renderer
- Fix offset in STEP export
- Fix offset in VRML export
There is no need to use mm_malloc at this moment. Explanation:
1) It was planned that there was advantadge to use aligned memory but it
was not measured the performance. 2) aligned memory is needed for use
with SIMD (i.e: SSE) but that is not used at moment.
Fixes: lp:1626278
https://bugs.launchpad.net/kicad/+bug/1626278
+ make the number of samples for reflection and refraction
parameterizable.
+ add some fuziness to reflection.
+ improvements on plastic normal texture
- crete an option for absorvance (works better to make the epoxy
different for regular transparent materials).
- visual fix an issue related with the epoxy render (square bands on the
render).
- fix a reflection issue (it was not take in account the reflection
material color).
Additionally, fix an unreported bug allowing zoom level to get stuck at
MAX_ZOOM.
Fixes: lp:1625754 (3dviewer zoom not limited with Use touchpad to pan)
https://bugs.launchpad.net/kicad/+bug/1625754
+ Implement sRGB to Linear and Linear to sRGB conversions.
+ Fix an issue in the AntiAliasing adaptive logic.
+ Improves the ambient color use on the shader.
+ Improves post-shader calculation. Fixes the saturated dark regions.
+ Improves the transparency of soldermak material.
+re-implement anti-aliasing, making it more acurate, not blured, better
and much faster (unsing much less lines of code)
+rewrite some function on camera and raypacket.
+small improvements on raytracing realtime, remove useless ifs
comparisons.
Use the correct math to unproject the mouse movement from screen space
to the Z=0 plane on the camera space. This handles both perspective
and orthographic projection at any window size or zoom level.
OpenMP does not yet permit unsigned loop counters. Most compilers seem
to allow them anyway, but a few have been seen to complain.
Mistake introduced in:
commit 82ed0fde32
Author: Chris Pavlina <pavlina.chris@gmail.com>
Date: Sun Aug 28 02:05:49 2016 -0400
Fix shared data access in raytracer, tidy up render loop
Render loop lost track of which blocks had been rendered due to a
synchronization issue. Specifically, std::vector<bool> is special-cased
as a bitfield and so is pretty much guaranteed not to be atomic unless
synchronized externally.
Also:
- Clean up types of a few variables
- Clean up openmp sharing type of variables (may result in better
optimization)
- Replace shared rendered block count with an openmp reduction (results
in fewer locks)
Fixes: lp:1608289
* https://bugs.launchpad.net/kicad/+bug/1608289
* Split and rewrite the preview window and canvas.
* Create a new class for handling the board information.
* Adds new render targets: openGL, legacy, and ray tracing.
* Render targets take full advantage of the new 3D plugins system and 3D cache
for a fast 3D model loading.
* Faster board loading.
* New OpenGL render is faster than the old one.
* New ray tracing render target with a post processing shader.
* Use of new 3D plugins (WRL, X3D, STEP and IGES) and 3D model caching.
* Preview of 3D model while browsing the file name.
* 3D preview of the footprint while adding / align 3D shapes.
* Render of 3D models according to attributes: Normal, Normal+Insert, Virtual.
* Pivot rotation centered in one point over the PCB board.
* Shortcuts keys improved for XYZ orientation..
* Animated camera.