-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add BatchedTilesPlugin * Add start to expanding batched mesh * Split out ExpandingBatchedMesh * Clean up * small fixes * Progress on getting things working * Check revision * Texture fixes * Small fixes * Some fixes to geometry expansion * remove extra count * Fix rendering * Fix instance deletion * Remove frustum culling * Get everything working * Fix score * Update raycasting logic * Add raycasting support * Update material support * Add docs * updates * Fix disposal * Handle all already loaded models * Add comments * more comments * fix disposal * some fixes * Remove unused fields * Add model view batched mesh * Adjust the model view batched mesh to use camera offset * Temporarily remove mipmaps * Handle cases where tiles have multiple geometries * Remove override * fix use of free ids * Limit the amount of instances to the size of a 3d texture * Add stand in options * Adjust instance count check * Support multiple geometries per tile * Handle incongruent attributes, texturs * Update plugin
- Loading branch information
Showing
9 changed files
with
821 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { MeshBasicMaterial } from 'three'; | ||
|
||
// A MeshBasicMaterial that supports taking a TextureArray and a layer to render | ||
export class ArrayTextureCopyMaterial extends MeshBasicMaterial { | ||
|
||
set layer( v ) { | ||
|
||
this._layerUniform.value = v; | ||
|
||
} | ||
|
||
get layer() { | ||
|
||
return this._layerUniform.value; | ||
|
||
} | ||
|
||
constructor( ...args ) { | ||
|
||
super( ...args ); | ||
this._layerUniform = { value: 0 }; | ||
|
||
} | ||
|
||
onBeforeCompile( shader ) { | ||
|
||
shader.uniforms.layer = this._layerUniform; | ||
|
||
shader.fragmentShader = shader.fragmentShader | ||
.replace( | ||
'#include <map_pars_fragment>', | ||
/* glsl */` | ||
#ifdef USE_MAP | ||
precision highp sampler2DArray; | ||
uniform sampler2DArray map; | ||
uniform int layer; | ||
#endif | ||
`, | ||
) | ||
.replace( | ||
'#include <map_fragment>', | ||
/* glsl */` | ||
#ifdef USE_MAP | ||
diffuseColor *= texture( map, vec3( vMapUv, layer ) ); | ||
#endif | ||
` | ||
); | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.