Skip to content

Commit

Permalink
fix: partial fix for triangle layer shaders
Browse files Browse the repository at this point in the history
  • Loading branch information
hkfb committed May 6, 2024
1 parent 337014a commit f0142c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ uniform sampler2D colormap;
uniform vec4 uColor;
uniform bool smoothShading;
out vec4 fragColor;
void main(void) {
vec3 normal = normals_commonspace;
Expand All @@ -42,8 +44,8 @@ void main(void) {
// Use two sided phong lighting. This has no effect if "material" property is not set.
vec3 lightColor = getPhongLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);
gl_FragColor = vec4(lightColor, 1.0);
DECKGL_FILTER_COLOR(gl_FragColor, geometry);
fragColor = vec4(lightColor, 1.0);
DECKGL_FILTER_COLOR(fragColor, geometry);
}
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ export type GeometryLines = {

export type Material =
| {
ambient: number;
diffuse: number;
shininess: number;
specularColor: [number, number, number];
}
ambient: number;
diffuse: number;
shininess: number;
specularColor: [number, number, number];
}
| boolean;

export interface PrivateTriangleLayerProps extends ExtendedLayerProps {
Expand All @@ -74,10 +74,6 @@ const defaultProps = {

// This is a private layer used only by the composite TriangleLayer
export default class PrivateTriangleLayer extends Layer<PrivateTriangleLayerProps> {
get isLoaded(): boolean {
return this.isLoaded ?? false;
}

initializeState(context: DeckGLLayerContext): void {
const gl = context.device;
const [triangleModel, lineMode] = this._getModels(gl);
Expand Down

0 comments on commit f0142c8

Please sign in to comment.