Skip to content
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

slow loading issue #63

Closed
levlups opened this issue Aug 21, 2019 · 3 comments
Closed

slow loading issue #63

levlups opened this issue Aug 21, 2019 · 3 comments
Labels

Comments

@levlups
Copy link

levlups commented Aug 21, 2019

Sorry to bother you Andy im using your colorfull example with the jumping slimes , im getting slow load times ,when loading new chunks , is this normal or I should upgrade to your latest build thanks , the reason i didnt upgrade is because I didnt see your updates before ,and I added so much code , it will be a pain to upgrade thanks

@fenomas
Copy link
Owner

fenomas commented Aug 21, 2019

Hi, I hate to bring bad news but that demo is reeeally old, I should put a note in the readme. To move to the current engine, you could try just updating the noa dependency and then fixing all the migration issues that occur, but I think it would probably be easier to start with a blank world in the current engine, and then copy over each feature you need.

Generally the best way to make a game on noa is to start by cloning the noa-examples repo, and then hacking on the world inside docs/hello-world. That is pretty much the absolute minimal world, so there's nothing to remove, and a clean slate to build on.

@levlups
Copy link
Author

levlups commented Aug 21, 2019

Andy when I remove the topwater that I added , its a material with a game.on(tick) wich creates a water animation , the speed is good now , I guess no water animation for me wath do you think

@fenomas
Copy link
Owner

fenomas commented Aug 21, 2019

I see, were you maybe changing the water's voxel ID (with setBlock) every tick? That would be very slow, as when voxel IDs change the engine has to re-mesh the entire chunk.

I haven't tried doing animated textures, but it should be possible. When you register a block material with noa, you can pass in a Babylon JS material, and then that material will be used for those voxels:

var blockmat = new StandardMaterial('', scene)
noa.registerMaterial(name, color, textureURL, texHasAlpha, blockmat) 

or something like that. Then, later on at runtime if you dynamically change that material's settings it should affect any mesh using the material, including any voxel terrain meshes using that block material.

Hope that makes sense. I'm not sure if there's any Babylon call you have to do when dynamically changing a material's texture, there might be a markDirty or something (as I believe there used to be in three.js).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants