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
07284e7e
Commit
07284e7e
authored
2 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
handle null-texture in calcTextureMeshColorSmoothing
parent
72055442
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
src/mol-geo/geometry/texture-mesh/color-smoothing.ts
+6
-4
6 additions, 4 deletions
src/mol-geo/geometry/texture-mesh/color-smoothing.ts
src/mol-gl/webgl/texture.ts
+14
-4
14 additions, 4 deletions
src/mol-gl/webgl/texture.ts
with
21 additions
and
8 deletions
CHANGELOG.md
+
1
−
0
View file @
07284e7e
...
...
@@ -11,6 +11,7 @@ Note that since we don't clearly distinguish between a public and private interf
-
Fix wrong offset when rendering text with orthographic projection
-
Update camera/handle helper when
`devicePixelRatio`
changes
-
Add various options to customize the axes camera-helper
-
Fix issue with texture-mesh color smoothing when changing themes
## [v3.30.0] - 2023-01-29
...
...
This diff is collapsed.
Click to expand it.
src/mol-geo/geometry/texture-mesh/color-smoothing.ts
+
6
−
4
View file @
07284e7e
/**
* Copyright (c) 2021-202
2
mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2021-202
3
mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
...
...
@@ -7,7 +7,7 @@
import
{
ValueCell
}
from
'
../../../mol-util
'
;
import
{
createComputeRenderable
,
ComputeRenderable
}
from
'
../../../mol-gl/renderable
'
;
import
{
WebGLContext
}
from
'
../../../mol-gl/webgl/context
'
;
import
{
Texture
}
from
'
../../../mol-gl/webgl/texture
'
;
import
{
isNullTexture
,
Texture
}
from
'
../../../mol-gl/webgl/texture
'
;
import
{
ShaderCode
}
from
'
../../../mol-gl/shader-code
'
;
import
{
createComputeRenderItem
}
from
'
../../../mol-gl/webgl/render-item
'
;
import
{
ValueSpec
,
AttributeSpec
,
UniformSpec
,
TextureSpec
,
Values
,
DefineSpec
}
from
'
../../../mol-gl/renderable/schema
'
;
...
...
@@ -267,7 +267,7 @@ export function calcTextureMeshColorSmoothing(input: ColorSmoothingInput, resolu
const
[
dx
,
dy
,
dz
]
=
gridDim
;
const
{
texDimX
:
width
,
texDimY
:
height
,
texCols
}
=
getTexture2dSize
(
gridDim
);
// console.log({ width, height, texCols,
d
im, resolution });
// console.log({ width, height, texCols,
gridD
im, resolution });
if
(
!
webgl
.
namedFramebuffers
[
ColorAccumulateName
])
{
webgl
.
namedFramebuffers
[
ColorAccumulateName
]
=
webgl
.
resources
.
framebuffer
();
...
...
@@ -363,7 +363,9 @@ export function calcTextureMeshColorSmoothing(input: ColorSmoothingInput, resolu
// normalize
if
(
isTimingMode
)
webgl
.
timer
.
mark
(
'
ColorNormalize.render
'
);
if
(
!
texture
)
texture
=
resources
.
texture
(
'
image-uint8
'
,
'
rgba
'
,
'
ubyte
'
,
'
linear
'
);
if
(
!
texture
||
isNullTexture
(
texture
))
{
texture
=
resources
.
texture
(
'
image-uint8
'
,
'
rgba
'
,
'
ubyte
'
,
'
linear
'
);
}
texture
.
define
(
width
,
height
);
const
normalizeRenderable
=
getNormalizeRenderable
(
webgl
,
accumulateTexture
,
countTexture
);
...
...
This diff is collapsed.
Click to expand it.
src/mol-gl/webgl/texture.ts
+
14
−
4
View file @
07284e7e
/**
* Copyright (c) 2018-202
2
mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2018-202
3
mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
* @author Gianluca Tomasello <giagitom@gmail.com>
...
...
@@ -554,12 +554,18 @@ export function createCubeTexture(gl: GLRenderingContext, faces: CubeFaces, mipm
//
const
NullTextureFormat
=
-
1
;
export
function
isNullTexture
(
texture
:
Texture
)
{
return
texture
.
format
===
NullTextureFormat
;
}
export
function
createNullTexture
(
gl
?:
GLRenderingContext
):
Texture
{
const
target
=
gl
?.
TEXTURE_2D
??
3553
;
return
{
id
:
getNextTextureId
(),
target
,
format
:
0
,
format
:
NullTextureFormat
,
internalFormat
:
0
,
type
:
0
,
filter
:
0
,
...
...
@@ -583,8 +589,12 @@ export function createNullTexture(gl?: GLRenderingContext): Texture {
gl
.
bindTexture
(
target
,
null
);
}
},
attachFramebuffer
:
()
=>
{},
detachFramebuffer
:
()
=>
{},
attachFramebuffer
:
()
=>
{
throw
new
Error
(
'
cannot attach null-texture to a framebuffer
'
);
},
detachFramebuffer
:
()
=>
{
throw
new
Error
(
'
cannot detach null-texture from a framebuffer
'
);
},
reset
:
()
=>
{},
destroy
:
()
=>
{},
...
...
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