Skip to content

Commit 9c32825

Browse files
committed
Still bug in PT with animation
1 parent de2c9a1 commit 9c32825

3 files changed

Lines changed: 18 additions & 17 deletions

File tree

modules/sl/source/accelstruct/SLCompactGrid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ void SLCompactGrid::build(SLVec3f minV, SLVec3f maxV)
140140
return;
141141
}
142142

143-
float f = cbrtf(DENSITY * _numTriangles / volume);
143+
float f = cbrtf(DENSITY * (float)_numTriangles / volume);
144144
_voxelSize.x = size.x / ceil(size.x * f);
145145
_voxelSize.y = size.y / ceil(size.y * f);
146146
_voxelSize.z = size.z / ceil(size.z * f);

modules/sl/source/mesh/SLMesh.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* \copyright http://opensource.org/licenses/GPL-3.0
66
* \remarks Please use clangformat to format the code. See more code style on
77
* https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
8-
*/
8+
*/
99

1010
#include <SLCompactGrid.h>
1111
#include <SLNode.h>
@@ -38,10 +38,10 @@ using std::set;
3838
* @details Meshes can be used in multiple nodes (SLNode). Meshes can belong
3939
* therefore to the global assets such as meshes (SLMesh), materials
4040
* (SLMaterial), textures (SLGLTexture) and shader programs (SLGLProgram).\n
41-
* It is important that during instantiation NO OpenGL functions (gl*)
42-
* get called because this constructor will be most probably called in a parallel
43-
* thread from within an SLScene::registerAssetsToLoad or SLScene::assemble
44-
* function. All objects that get rendered have to do their OpenGL initialization
41+
* It is important that during instantiation NO OpenGL functions (gl*)
42+
* get called because this constructor will be most probably called in a parallel
43+
* thread from within an SLScene::registerAssetsToLoad or SLScene::assemble
44+
* function. All objects that get rendered have to do their OpenGL initialization
4545
* when they are used the first time during rendering in the main thread.
4646
* @param assetMgr Pointer to a global asset manager. If passed the asset
4747
* manager is the owner of the instance and will do the deallocation. If a

modules/sl/source/ray/SLRaytracer.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* \copyright http://opensource.org/licenses/GPL-3.0
66
* \remarks Please use clangformat to format the code. See more code style on
77
* https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
8-
*/
8+
*/
99

1010
#ifndef SLRAYTRACER_H
1111
#define SLRAYTRACER_H
@@ -51,9 +51,10 @@ SLRaytracer implements the methods render, eyeToPixel, trace and shade for
5151
classic Whitted style Ray Tracing. This class is a friend class of SLScene and
5252
can access via the pointer _s all members of SLScene. The scene traversal for
5353
the ray intersection tests is done within the intersection method of all nodes.
54+
The result is written into an image of an SLGLTexture and that then is rendered
55+
with OpenGL in a orthographic projection.
5456
*/
5557
class SLRaytracer : public SLGLTexture
56-
, public SLEventHandler
5758
{
5859
public:
5960
SLRaytracer();
@@ -133,7 +134,7 @@ class SLRaytracer : public SLGLTexture
133134

134135
protected:
135136
function<void(bool, SLuint)> renderSlicesAsync;
136-
function<void(bool, SLuint)> sampleAAPixelsAsync;
137+
function<void(bool, SLuint)> sampleAAPixelsAsync;
137138

138139
SLSceneView* _sv; //!< Parent sceneview
139140
SLRTState _state; //!< RT state;
@@ -147,14 +148,14 @@ class SLRaytracer : public SLGLTexture
147148
SLfloat _renderSec; //!< Rendering time in seconds
148149
AvgFloat _raysPerMS; //!< Averaged rays per ms
149150

150-
SLfloat _pxSize; //!< Pixel size
151-
SLVec3f _eye; //!< Camera position
152-
SLVec3f _la, _lu, _lr; //!< Camera lookat, lookup, lookright
153-
SLVec3f _bl; //!< Bottom left vector
154-
SLint _nextLine; //!< next line index to render RT in a thread
155-
SLVPixel _aaPixels; //!< Vector for antialiasing pixels
156-
SLfloat _gamma; //!< gamma correction value
157-
SLfloat _oneOverGamma; //!< one over gamma correction value
151+
SLfloat _pxSize; //!< Pixel size
152+
SLVec3f _eye; //!< Camera position
153+
SLVec3f _la, _lu, _lr; //!< Camera lookat, lookup, lookright
154+
SLVec3f _bl; //!< Bottom left vector
155+
SLint _nextLine; //!< next line index to render RT in a thread
156+
SLVPixel _aaPixels; //!< Vector for antialiasing pixels
157+
SLfloat _gamma; //!< gamma correction value
158+
SLfloat _oneOverGamma; //!< one over gamma correction value
158159

159160
// variables for distributed ray tracing
160161
SLfloat _aaThreshold; //!< threshold for anti aliasing

0 commit comments

Comments
 (0)