Removal of the layer count restriction#2612
Conversation
|
Could you open a proposal for this PR? Describing what problem you want to resolve and explain your solution. =) |
a424058 to
e963972
Compare
e963972 to
c2a1517
Compare
|
|
||
| rtCache.set(textureSetId, renderTarget); | ||
| } else { | ||
| drawMap(renderTarget, tiles, renderer, extent); |
There was a problem hiding this comment.
If we're caching the render targets, what is the use of redrawing their textures every time we access them? Am I missing something?
There was a problem hiding this comment.
Yes, it's temporary. I'll add a mechanism to update the texture and parent texture when the opacity changes.
|
|
||
| drawMap(renderTarget, tiles, renderer, extent); | ||
|
|
||
| rtCache.set(textureSetId, renderTarget); |
There was a problem hiding this comment.
I was caching array render targets instead of array textures because it was impossible to extract the textures from the RTs and manage their memory separately, but maybe now that you're using simple render targets, this becomes possible and we can just maintain a cache of textures directly, and only use one RT for everything?
There was a problem hiding this comment.
I'm not sure, There might be a problem with the framebuffer linked to the render target
To try
| renderer.setRenderTarget(previousRenderTarget); | ||
| renderer.setClearAlpha(a); | ||
|
|
||
| return renderTarget; |
There was a problem hiding this comment.
The returned value is not used anymore and the documented type is now incorrect
There was a problem hiding this comment.
it's draft PR, it's still evolving, no need for an in-depth review right now
| @@ -94,86 +94,35 @@ const rtCache = new LRUCache<string, THREE.WebGLArrayRenderTarget>({ | |||
| * @param type - Layer set identifier: 'c' for color, 'e' for elevation. | |||
| * @param renderer - The renderer used to render textures. | |||
| uniform vec4 offsetScale; | ||
| uniform float opacity; | ||
|
|
||
| const float CTOYL = 20037508.34 / 3.141592653589793 * 0.69314718; |
There was a problem hiding this comment.
Could you comment what these numbers represent?
There was a problem hiding this comment.
i'll add some comment
- 20037508.34 : max projection in speudo mercator
- 0,69... : Ln(2)
| uniforms: { | ||
| // This uniform will be updated with each source 2D texture | ||
| map: { value: null }, | ||
| texture_footprint: { value: new THREE.Vector2() }, |
There was a problem hiding this comment.
Could you comment what these properties represent?
There was a problem hiding this comment.
Footprint means the area/extent covered by something on the ground.
map: map to project on the groundtexture_footprint: texture coverage on groundcamera_footprint: camera coverage visible on groundoffsetScale: the map portion to be projected
c2a1517 to
813670b
Compare
813670b to
92e746a
Compare
743300c to
e40bdb5
Compare
6b4f653 to
b8f2e2e
Compare
b8f2e2e to
cfeace0
Compare
cfeace0 to
42f3068
Compare
42f3068 to
f81e8c3
Compare
WARNING : There’s still unresolved bugs:
Description
Replace all textures array by just 2 textures, map and displacement map. All array textures are flatten in these maps.
Motivation and Context
LayeredMaterialwith any Three.js materials