Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Project_Phoenix
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LuFG VR VIS
VR-Group
Project_Phoenix
Commits
0cf9be4d
Commit
0cf9be4d
authored
6 years ago
by
Sebastian Pape
Browse files
Options
Downloads
Patches
Plain Diff
Added better ray rendering, now, they are not drawn above everything anymore
parent
4b5c2c3f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
demos/optical_bench/src/optix_pass.cpp
+3
-0
3 additions, 0 deletions
demos/optical_bench/src/optix_pass.cpp
demos/optical_bench/src/ray_pass.cpp
+6
-6
6 additions, 6 deletions
demos/optical_bench/src/ray_pass.cpp
with
9 additions
and
6 deletions
demos/optical_bench/src/optix_pass.cpp
+
3
−
0
View file @
0cf9be4d
...
@@ -195,7 +195,10 @@ void OptixPass::copyBuffersAndRenderInOpenGL(RenderTarget* render_target) {
...
@@ -195,7 +195,10 @@ void OptixPass::copyBuffersAndRenderInOpenGL(RenderTarget* render_target) {
glEnable
(
GL_DEPTH_TEST
);
glEnable
(
GL_DEPTH_TEST
);
glDepthFunc
(
GL_LESS
);
glDepthFunc
(
GL_LESS
);
glDepthMask
(
GL_FALSE
);
glDrawArrays
(
GL_TRIANGLES
,
0
,
6
);
glDrawArrays
(
GL_TRIANGLES
,
0
,
6
);
glDepthMask
(
GL_TRUE
);
glBindVertexArray
(
0
);
glBindVertexArray
(
0
);
shader_program_
->
unuse
();
shader_program_
->
unuse
();
...
...
This diff is collapsed.
Click to expand it.
demos/optical_bench/src/ray_pass.cpp
+
6
−
6
View file @
0cf9be4d
...
@@ -205,19 +205,18 @@ void RayPass::render(RenderTarget* render_target) {
...
@@ -205,19 +205,18 @@ void RayPass::render(RenderTarget* render_target) {
glBindVertexArray
(
vaoOpenGL
);
glBindVertexArray
(
vaoOpenGL
);
glEnable
(
GL_BLEND
);
glEnable
(
GL_DEPTH_TEST
);
glEnable
(
GL_DEPTH_TEST
);
glDepthFunc
(
GL_ALWAYS
);
glEnable
(
GL_BLEND
);
// Draw with additive blending and depth test, but now write
glBlendFunc
(
GL_ONE
,
GL_ONE
);
glBlendFunc
(
GL_ONE
,
GL_ONE
);
glDepthMask
(
GL_FALSE
);
glDrawArrays
(
GL_LINES
,
0
,
50
*
50
*
laser_max_depth
*
2
);
glDrawArrays
(
GL_LINES
,
0
,
50
*
50
*
laser_max_depth
*
2
);
glDepthMask
(
GL_TRUE
);
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
glBindVertexArray
(
0
);
glBindVertexArray
(
0
);
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
glDepthFunc
(
GL_LESS
);
shader_program_
->
unuse
();
shader_program_
->
unuse
();
render_target
->
unbind
();
render_target
->
unbind
();
}
}
...
@@ -373,6 +372,7 @@ void RayPass::createTarget() {
...
@@ -373,6 +372,7 @@ void RayPass::createTarget() {
glm
::
mat4
trans
=
glm
::
mat4
trans
=
targetEntity
->
GetFirstComponent
<
phx
::
Transform
>
()
->
GetGlobalMatrix
();
targetEntity
->
GetFirstComponent
<
phx
::
Transform
>
()
->
GetGlobalMatrix
();
targetTransform
->
setMatrix
(
true
,
&
(
trans
[
0
][
0
]),
&
(
inverse
(
trans
)[
0
][
0
]));
targetTransform
->
setMatrix
(
true
,
&
(
trans
[
0
][
0
]),
&
(
inverse
(
trans
)[
0
][
0
]));
optixContextManager_
->
getTopObject
()
->
getAcceleration
()
->
markDirty
();
});
});
selector
->
SetRelease
([
this
]()
{
selector
->
SetRelease
([
this
]()
{
if
(
getTargetBufferWrite
())
clearTargetBuffers
();
if
(
getTargetBufferWrite
())
clearTargetBuffers
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment