-
Notifications
You must be signed in to change notification settings - Fork 315
Removal of the layer count restriction #2612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The returned value is not used anymore and the documented type is now incorrect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's draft PR, it's still evolving, no need for an in-depth review right now
| * @param tiles - An array of RasterTile objects, each containing textures. | ||
| * @param max - The maximum number of layers for the DataArrayTexture. | ||
| * @param type - Layer set identifier: 'c' for color, 'e' for elevation. | ||
| * @param renderer - The renderer used to render textures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be updated
| uniform vec4 offsetScale; | ||
| uniform float opacity; | ||
| const float CTOYL = 20037508.34 / 3.141592653589793 * 0.69314718; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you comment what these numbers represent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you comment what these properties represent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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