#Probuilder meshes

1 messages ยท Page 1 of 1 (latest)

rapid mesa
#

I was wondering, should we avoid having multiple different materials on a single probuilder mesh?
Which of these 2 is better?

  1. one probuilder mesh with 2 different materials on it
  2. two probuilder meshes, each with one material
    Is there a performance difference? Should we split up meshes based on their materials?
rigid salmon
#

depends on how big your scene is, generally multiple materials for each mesh is a bad idea since it will use a drawcall for each material on the mesh

The most optimized way you could do it is make the mesh in a 3D modeling software apply multiple materials there then bake them into 1 texture and import that, if you want to use probuilder you can make the mesh in probuilder export it to a 3D modeling software and add materials and bake textures there, but you shouldnt worry about that unless your scene is rly big and contains tons of probuilder obejcts

zealous magnet
#

The question is best answered with another question ๐Ÿ˜„ ๐Ÿ˜›
... what is the current purpose of your work?

If prototyping or iterating on an idea - don't worry, just do the fastest thing. That's usually multiple materials, or even just using vertex colors to "fake" the materials. ProBuilder is great to do that fast and easy.

Later on, yes, as @rigid salmon suggests, you might want to bake that down to a single material. However, that also has it's own disadvantages - you can't use performance-saving tiling textures, you might end up with a really big texture size, it's much more difficult to iterate/change.

Generally, if you are working in ProBuilder, that means you are prototyping/designing/ideating ... and I'd recommend just not worrying about performance at all. When perf starts to matter, first figure out what the perf issue is (texture size? draw calls? scripts?), then dig into that ๐Ÿ™‚

rapid mesa
# zealous magnet The question is best answered with another question ๐Ÿ˜„ ๐Ÿ˜› ... what is the curre...

well baking textures from a mesh doesnt seem good to me, since that adds an extra texture into your game that takes up memory and increases game file size, right?

im wondering whats good practice. for example i have a cube and you want each side to be a different material. do i just

  1. make a probuilder cube and assign a material to each face,
    or do i
  2. split the probuilder cube into 6 separate gameobjects (one gameobject for each mesh face) so this way i have a separate material on every gameobject

which of those two would be better practice? in this case of course the overhead from 5 extra gameobjects might be bad but imagine this on a lower scale with turning 1 gameobject into 2 for example.
or is the performance difference negligible and the overhead from having multiple gameobjects is way bigger?

zealous magnet
#

baking textures can be very very good, since it means you only have one, vs many ... but also yes it's larger. As always in game dev, it's a matter of tradeoffs, and which is best for your situation ๐Ÿ™‚

#

Regarding 1vs2 above, 1 for sure. At least, until you get far far into the game creation and know what you need to optimize.

rapid mesa
# zealous magnet Regarding 1vs2 above, 1 for sure. At least, until you get far far into the game ...

Thank you for the answers, I have one more question if you dont mind. How possible is it to make a probuilder level the size of the gta san andreas map? Or even maybe not that big but half as big for example. unity is a modern game engine and that game is very old so it shouldn't be a problem, right? I just want to know the details of doing something like this before I start. Cause I dont want to run into problems. Will there be any problems and what would they be? And the whole thing would be made with probuilder (also i am not using probuilder for prototyping).

analog raptor
#

Culling, lodding, sensible shaders, world streaming...
Yes, it is a problem, it's not easy, but they are solved problems that you can find resources and tools to reduce/solve

rapid mesa
# analog raptor Culling, lodding, sensible shaders, world streaming... Yes, it is a problem, it'...

how will that work together with the entire world made of probuilder meshes though? they're all a gameobject (idk what the performance overhead of that is) and they all have mesh colliders, what would the performance be like if there's this many mesh colliders? turning them into box colliders would take a LOT of tedious work so pretend that they have to be mesh colliders and cant be changed. of course the objects colliding with said mesh colliders will not be mesh colliders themselves. what do you think about the performance (in the context of a massive gta sized game with world streaming or such)?

rapid mesa
#

@zealous magnet @analog raptor i'm still waiting for an answer to this by the way

rapid mesa
#

@zealous magnet one more question, in this video https://youtu.be/kML67qB9Chk?t=130 at 2:10 through 3:14, the person says probuilder does lots of bad stuff causing it to be unsuitable for a full game. how true are his claims? especially the one where he says every time you do something all the probuilder meshes have to rebuild or something

Making huge games in unity can quickly lead to problems - hopefully this video can help you to avoid them.

Links:

CrossScene Reference / GUID Based Reference:
https://github.com/Unity-Technologies/guid-based-reference

Material Property Override:
https://github.com/Unity-Technologies/FPSSample/tree/master/Assets/Tools/MaterialPropertyOverrid...

โ–ถ Play video