Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clipping planes #486

Merged
merged 3 commits into from
Aug 8, 2018
Merged

Clipping planes #486

merged 3 commits into from
Aug 8, 2018

Conversation

hernando
Copy link
Contributor

@hernando hernando commented Aug 2, 2018

No description provided.

@hernando hernando changed the title Unlimited clipping planes Clipping planes Aug 2, 2018
virtual bool isSideBySideStereo() const { return false; }

/** @intenal */
virtual void takeSceneParameters(const Scene&) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be in ospray layer only?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I had originally, but I couldn't find a way to include the clipping planes in the SnapshotFunctor without doing dynamic_cast to the OSPRay objects.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, why not let the renderer handle in both cases (snapshot and 'normal' use, rather than in the engine)? The renderer knows camera and scene. I'd like to avoid to leak this 'knowledge' about clipping planes update like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only solution would be to do it in Renderer::commit, but for that to work it needs to become responsible of committing the camera and the scene. The reason is that I cannot commit the camera before the planes are set and committing the camera after the renderer was not working. If you're happy with that, I can give it a try.
However, it's unclear if we will be causing a new problem as the camera and scene commit are not supposed to be called from somewhere else anymore.

Another solution is to commit. the camera from the OSPRay base renderer regardless of the commits done externally. This may be redundant work, but if the overhead is negligible it may be the cleanest solution.

In both cases I wonder what happens with alternative renderers, are all the different ISPC codes using OSPRayRenderer as the C++ side object? Is there a plugin that overrides OSPRayRenderer and is it supposed to call its commit methods in that case?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solution 2) is definitely working, and you would only commit the camera from the renderer if the scene/clipping-planes are modified, so not much overhead normally.

The OSPRayRenderer cannot be overridden by plugins; only engine-agnostic classes are visible for plugins. Plugins are also advised to avoid calling commit() on the brayns objects.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solution 2 works

@@ -198,6 +198,7 @@ void OSPRayEngine::preRender()
const auto& renderParams = _parametersManager.getRenderingParameters();
if (renderParams.getAccumulation() != _frameBuffer->getAccumulation())
_frameBuffer->setAccumulation(renderParams.getAccumulation());
_camera->takeSceneParameters(*_scene);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just cast camera to OSPRayCamera to not need takeSceneParameters() in base class

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't even need to cast because _camera is an OSPCamera. Originally I had _camera->setClipPlanes(_scene->getClipPlanes()), but I changed it to make the smallest modification that also works in the SnapshotFunctor.

@hernando hernando force-pushed the master branch 4 times, most recently from afb2daa to 4f88a8f Compare August 7, 2018 10:23
@hernando
Copy link
Contributor Author

hernando commented Aug 8, 2018

ping

@@ -43,6 +43,9 @@ class OSPRayCamera : public Camera
*/
void commit() final;

/** */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty?

Copy link
Contributor

@tribal-tec tribal-tec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good otherwise

@ppodhajski
Copy link
Contributor

retest this please

@hernando hernando force-pushed the master branch 2 times, most recently from 60d634c to 5c5421a Compare August 8, 2018 15:25
Juan Hernando Vieites added 3 commits August 8, 2018 17:26
@hernando hernando merged commit 3c1538a into BlueBrain:master Aug 8, 2018
Copy link
Contributor

@rolandjitsu rolandjitsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't have added this to the Python client for Brayns.

Parsing data or inferring the type of the data should be the responsibility of the user and not the lib (in this case the params). The user should make sure that the passed data/params is proper json serializable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants