-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9bc5d17
commit 27c6702
Showing
9 changed files
with
161 additions
and
50 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
modules/aggregation-layers/src/heatmap-layer/heatmap-layer-uniforms.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import {Texture} from '@luma.gl/core'; | ||
import type {ShaderModule} from '@luma.gl/shadertools'; | ||
|
||
const uniformBlock = `\ | ||
uniform weightUniforms { | ||
vec4 commonBounds; | ||
float radiusPixels; | ||
float textureWidth; | ||
float weightsScale; | ||
} weight; | ||
`; | ||
export type WeightProps = { | ||
commonBounds: [number, number, number, number]; | ||
radiusPixels: number; | ||
textureWidth: number; | ||
weightsScale: number; | ||
weightsTexture: Texture; | ||
}; | ||
|
||
export const weightUniforms = { | ||
name: 'weight', | ||
vs: uniformBlock, | ||
uniformTypes: { | ||
commonBounds: 'vec4<f32>', | ||
radiusPixels: 'f32', | ||
textureWidth: 'f32', | ||
weightsScale: 'f32' | ||
} | ||
} as const satisfies ShaderModule<WeightProps>; | ||
|
||
export type MaxWeightProps = { | ||
inTexture: Texture; | ||
textureSize: number; | ||
}; | ||
|
||
export const maxWeightUniforms = { | ||
name: 'maxWeight', | ||
vs: `\ | ||
uniform maxWeightUniforms { | ||
float textureSize; | ||
} maxWeight; | ||
`, | ||
uniformTypes: { | ||
textureSize: 'f32' | ||
} | ||
} as const satisfies ShaderModule<MaxWeightProps>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
modules/aggregation-layers/src/heatmap-layer/triangle-layer-uniforms.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import {Texture} from '@luma.gl/core'; | ||
import type {ShaderModule} from '@luma.gl/shadertools'; | ||
|
||
const uniformBlock = `\ | ||
uniform triangleUniforms { | ||
float aggregationMode; | ||
vec2 colorDomain; | ||
float intensity; | ||
float threshold; | ||
} triangle; | ||
`; | ||
|
||
export type TriangleProps = { | ||
aggregationMode: number; | ||
colorDomain: [number, number]; | ||
intensity: number; | ||
threshold: number; | ||
colorTexture: Texture; | ||
maxTexture: Texture; | ||
weightsTexture: Texture; | ||
}; | ||
|
||
export const triangleUniforms = { | ||
name: 'triangle', | ||
vs: uniformBlock, | ||
fs: uniformBlock, | ||
uniformTypes: { | ||
aggregationMode: 'f32', | ||
colorDomain: 'vec2<f32>', | ||
intensity: 'f32', | ||
threshold: 'f32' | ||
} | ||
} as const satisfies ShaderModule<TriangleProps>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters