Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
a50e8155
Commit
a50e8155
authored
2 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
use ssao-scale for gl viewport/scissor
parent
86512bce
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
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
src/mol-canvas3d/passes/postprocessing.ts
+23
-15
23 additions, 15 deletions
src/mol-canvas3d/passes/postprocessing.ts
with
24 additions
and
15 deletions
CHANGELOG.md
+
1
−
0
View file @
a50e8155
...
...
@@ -9,6 +9,7 @@ Note that since we don't clearly distinguish between a public and private interf
-
Add occlusion color parameter
-
Fix issue with outlines and orthographic camera
-
Reduce over-blurring occlusion at larger view distances
-
Fix occlusion artefact with non-canvas viewport and pixel-ratio > 1
## [v3.31.4] - 2023-02-24
...
...
This diff is collapsed.
Click to expand it.
src/mol-canvas3d/passes/postprocessing.ts
+
23
−
15
View file @
a50e8155
...
...
@@ -709,10 +709,6 @@ export class PostprocessingPass {
state
.
disable
(
gl
.
BLEND
);
state
.
disable
(
gl
.
DEPTH_TEST
);
state
.
depthMask
(
false
);
const
{
x
,
y
,
width
,
height
}
=
camera
.
viewport
;
state
.
viewport
(
x
,
y
,
width
,
height
);
state
.
scissor
(
x
,
y
,
width
,
height
);
}
private
occlusionOffset
:
[
x
:
number
,
y
:
number
]
=
[
0
,
0
];
...
...
@@ -731,20 +727,21 @@ export class PostprocessingPass {
if
(
isTimingMode
)
this
.
webgl
.
timer
.
mark
(
'
PostprocessingPass.render
'
);
this
.
updateState
(
camera
,
transparentBackground
,
backgroundColor
,
props
,
light
);
if
(
props
.
outline
.
name
===
'
on
'
)
{
this
.
outlinesTarget
.
bind
();
this
.
outlinesRenderable
.
render
();
}
if
(
props
.
shadow
.
name
===
'
on
'
)
{
this
.
shadowsTarget
.
bind
();
this
.
shadowsRenderable
.
render
();
}
const
{
gl
,
state
}
=
this
.
webgl
;
const
{
x
,
y
,
width
,
height
}
=
camera
.
viewport
;
// don't render occlusion if offset is given,
// which will reuse the existing occlusion
if
(
props
.
occlusion
.
name
===
'
on
'
&&
this
.
occlusionOffset
[
0
]
===
0
&&
this
.
occlusionOffset
[
1
]
===
0
)
{
if
(
isTimingMode
)
this
.
webgl
.
timer
.
mark
(
'
SSAO.render
'
);
const
sx
=
Math
.
floor
(
x
*
this
.
ssaoScale
);
const
sy
=
Math
.
floor
(
y
*
this
.
ssaoScale
);
const
sw
=
Math
.
ceil
(
width
*
this
.
ssaoScale
);
const
sh
=
Math
.
ceil
(
height
*
this
.
ssaoScale
);
state
.
viewport
(
sx
,
sy
,
sw
,
sh
);
state
.
scissor
(
sx
,
sy
,
sw
,
sh
);
if
(
this
.
ssaoScale
<
1
)
{
this
.
downsampledDepthTarget
.
bind
();
this
.
downsampleDepthRenderable
.
render
();
...
...
@@ -761,14 +758,25 @@ export class PostprocessingPass {
if
(
isTimingMode
)
this
.
webgl
.
timer
.
markEnd
(
'
SSAO.render
'
);
}
state
.
viewport
(
x
,
y
,
width
,
height
);
state
.
scissor
(
x
,
y
,
width
,
height
);
if
(
props
.
outline
.
name
===
'
on
'
)
{
this
.
outlinesTarget
.
bind
();
this
.
outlinesRenderable
.
render
();
}
if
(
props
.
shadow
.
name
===
'
on
'
)
{
this
.
shadowsTarget
.
bind
();
this
.
shadowsRenderable
.
render
();
}
if
(
toDrawingBuffer
)
{
this
.
webgl
.
unbindFramebuffer
();
}
else
{
this
.
target
.
bind
();
}
const
{
gl
,
state
}
=
this
.
webgl
;
this
.
background
.
update
(
camera
,
props
.
background
);
if
(
this
.
background
.
isEnabled
(
props
.
background
))
{
if
(
this
.
transparentBackground
)
{
...
...
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