// We store the TileSamplers directly in this TerrainNode: protected samplers: TileSampler[] = []; // Add one TileSampler: public addTileSampler(sampler: TileSampler) { this.samplers.push(sampler); }
TileSampler.getTerrain()
: OKTileSampler.checkUniforms()
: OKGPUTileStorage.getTileMap()
: OKGPUTileStorage.generateMipMap()
: OKFrameBuffer.drawQuad()
: OKpublic getDefaultQuad(): Mesh { if (this.quad == null) { let indexType = AttributeType.UNSIGNED_SHORT; let meshMode = MeshMode.TRIANGLE_STRIP; let meshUsage = MeshUsage.GPU_STATIC; // For each vertex, we pass the 4 position coordinates as float: let nverts = 4; // Size of 1 vertex in bytes: let vertSize = 4 * 4; // create the mesh: this.quad = new Mesh(vertSize, indexType, meshMode, meshUsage, nverts); this.quad.addAttributeType(0, 4, AttributeType.FLOAT, false); this.quad.addVertexElements([-1, -1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, 1, 1, 0, 1]); } return this.quad; }
TileSampler.setTileMap()
: OKthis.mipmapProg = await rman.loadProgram('tileStorageMipMap');
TileSampler.setTile()
function, let's fix that: OKTile.getData()
method.TileStorage::Slot *TileCache::Tile::getData(bool check) { bool isDone = task->isDone(); assert(isDone || !check); assert(getTId() == data->id || !check); return isDone ? data : NULL; }
setTile()
on the TileSamplers, but there is no location where we actually create a task to “produce that tile”, what am I missing in this process ?Tile
constructor is never called in fact.)TileCache.getTile
: this should probably be called somewhere…TileProducer.startCreateTile
(which I have not implemented yet in my Elevation/normal producers).TileProducer.hasTile
and TileProducer.findTile
at some locations ⇒ So this could be where we start the creation of the tiles ?<sequence name="updateTerrainMethod"> <updateTerrain name="this.terrain"/> <updateTileSamplers name="this.terrain"/> </sequence>
* hmmmm... 🥴 OK, so... I'm not really convinced anymore I can really go somewhere with this implementation of the project: in Javascript we don't have any real/proper support for multithreading: so, whenever I want to update an object on a different thread, I'm in serious trouble. And I'm just realizing that the "TaskGraph" system in use in Proland is doing precisely that all over the place 😳 So how am I doing to cope with that ? Sounds too complex for too limited results.