Relintai/voxelman

Voxelman assume library has at least 4 materials

Opened this issue · 4 comments

image

Errors will go away once you have 4 materials.

I think is coming from TerrarinJob. I see a lot of material_get() with values 0 , 1, 2 and 3 in there. Maybe start off with 4 opaque white ShaderMaterial COLOR = vec4(1,1,1,1) fragment by default when creating a new library?

Also is TerrarinJob a typo? Should it be TerrainJob?

Yes, it's because of the default lod setup.

Maybe start off with 4 opaque white ShaderMaterial COLOR = vec4(1,1,1,1) fragment by default when creating a new library?

I thought about this originally, but I think this would be more confusing in the long run. This would be cool to do in the editor, but then it would cause annoyances if you allocate a library from code.

I think improving the error message is the right thing to do here, as you probably want lods by default (at least I'd want to have it on by default). I'll do this a bit later.

I think (I hope) I already ported the generalization of the lod system to this, if not I'll do that too.

Also is TerrarinJob a typo?

Yes. A very dump one.
Will be fixed.

A better error message makes sense and seems reasonable compromise. 👍

Or alternatively it could just get and use the first available material. So if you set only one it would just use that for all lod levels.

Or both. - Like if there is no material set at it will tell you how much you might want to add. If one is set it will just use that for all lod levels.

I'll think about it a bit more.

Edit: I just checked it, I haven't yet ported job steps to this (a.k.a scriptable lod generation setup), only brought it over to the props module. +1 thing to port.

Edit2: I wanted to do this for a while now, so now that I'm at breaking all the things, I will probably also set up chunk changed callbacks into the LevelGenerator (It will be renamed) class, so chunk saving can easily be implemented in a central location.

With 32b98c0 this should be fixed.