Jump to content

Best way to bake diffuse color from high poly mesh to low poly?


arisaie
 Share

You are about to reply to a thread that has been inactive for 557 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I'm currently trying to make autumn leaves that are on top of my mesh.

I did the rand position on surface in blender with geometry nodes. 

It adz around 1400 vertices . I thought well that's not much.. just nuke LOd1 and LOD0 on upload. As long it's around1LI then it's OK right? 

Then I got the idea to just use planes and bake the leaves to planes. 

 

But this is the problem when I bake the leaves onto the plane , the result is very pixelated. Like you wouldn't even recognize it's a leave.

I tried upscaling the bake texture to 4k...upscaled my leave image to 2k..but after baking it's still very much pixelated.

 

My plane UV islands are correct sizes (according to texel density)

 

Any idea how I could bake the leaves into the substitute plane and get a sharp image? 

I'm also baking only diffuse color without any light lighting (it's turned off)

 

Or should I just use the physical geometry nodes result? Sure it's a lot of faces but the 256x256 texture will be used on all faces. And the 256x256 texture looks good 

Link to comment
Share on other sites

1 hour ago, arisaie said:

I'm currently trying to make autumn leaves that are on top of my mesh.

I did the rand position on surface in blender with geometry nodes. 

It adz around 1400 vertices . I thought well that's not much.. just nuke LOd1 and LOD0 on upload. As long it's around1LI then it's OK right? 

Then I got the idea to just use planes and bake the leaves to planes. 

 

But this is the problem when I bake the leaves onto the plane , the result is very pixelated. Like you wouldn't even recognize it's a leave.

I tried upscaling the bake texture to 4k...upscaled my leave image to 2k..but after baking it's still very much pixelated.

 

My plane UV islands are correct sizes (according to texel density)

 

Any idea how I could bake the leaves into the substitute plane and get a sharp image? 

I'm also baking only diffuse color without any light lighting (it's turned off)

 

Or should I just use the physical geometry nodes result? Sure it's a lot of faces but the 256x256 texture will be used on all faces. And the 256x256 texture looks good 

In order to reduce the resolution/number of unique textures that your tree requires try isolating one or two generic looking branches and only baking the textures for those.  Then place copies of those new low-poly branches around the tree so you re-use the same branch textures multiple times rather than requiring a unique texture for every branch/leaf on the tree.

  • Like 1
Link to comment
Share on other sites

2 hours ago, arisaie said:

I'm currently trying to make autumn leaves that are on top of my mesh.

I'm not sure if I understand your question correctly but if I do, you're talking about a surface covered with leaves, not leaves on a tree, right?

If so, here's something similar, a plastered wall covered with ivy:

image.thumb.png.08ca3805ba04c21f9f9050ceb0047fb0.png

The texture resolution isn't great but good enough. And it's a 512x512, if I really needed more, I'd use a 1024 instead:

image.png.51d13c7a64d2f492f070dba89ba9c274.png

The foliage is three dimensional with branches at different distances from the wall and often angled away from or towards the wall. That doesn't show up well in a picture so you have to take my word for it.

It's a modluar system with different parts that can be combined in various ways to fit different wall sizes and shapes and give different amounts of coverage. This particular example has 356 vertices and 180 tris but it uses 13 modules (covering 12x5 m) so the LI couldn't be lower than 7 no matter how much I reduced the tri and vertice counts. If I were to make something similar as a single mesh, I could have reduced the mesh complexity significantly, possibly not all the way down to 1 for a mesh as big as this but certainly down to 2 or 3.

The texture is fairly simple, it looks like this (except I scaled it down here, sorry I don't want to post full size copies of my textures on the forums):

image.png.a2796db69557c393df65c6eb5110e4cc.png

The trick is to use multiple overlapping panels instead of just a single big one and also to use texture repeats for all they're worth. Here's one of the modules:

image.png.3e7613fb755196d051b4a0b9be46bf58.png

This one only has two panels, so 8 vertices and 4 tris, but it has five instances of the texture with each panel covering the gaps in the other one:

image.png.990d0c1bff681ca7144ba3a32dfb5fcc.png

You get the idea? Getting it right with a good coverage and no visible repeats is a bit of an art both when it comes to texture creation and mesh making but it's not that difficult and it's sooo worth it!

As for LI and LOD, you can make a 1 LI mesh with at least 6 single sided flat panels without reducing the LOD at all - use LOD above all the way. You should be able to get away with 10-12 and, depending on how they are configured, the alignment of the planets and the actions of a quantum butterfly in Inner Manchuria, you may be able to cram 20 or more panels into a single full LOD 1 LI mesh.

Edited by ChinRey
  • Like 1
Link to comment
Share on other sites

15 hours ago, ChinRey said:

I'm not sure if I understand your question correctly but if I do, you're talking about a surface covered with leaves, not leaves on a tree, right?

 

Yes exactly ChinRey. I meant a surface covered in leaves.

Thank you for your detailed explanation.

I intend to add autumn(leaves fallen on surface) and winter(snow cover on surface) option to my mesh. Just a few of the leaves scattered around the mesh and the ground.

The problem is with the baked resolution of the leaves. Your example looks much better.ex1_001.thumb.png.3f6302f66d6e666496741a11a714a019.png

Here is a picture of how I would imagine it. (theres more above) This is done with blender geometry nodes where planes are scattered across my mesh. Each plane uses the same material -  256x256 pixel image of a leaf. The problem with this it adds up to more than 1400 vertices. And I had to make LOD1 and LOD0 to a single triangle otherwise the LI goes to 3.8.

ex2_001.thumb.png.9deacb5013280bcef8fe54f797594947.png

This is the closeup of leaves on individual planes.

ex3_001.thumb.png.e50d73e667d4dfb1e13ddf54191af599.png

And this is how the baked texture looks if I bake the individual leaves to a singular plane in blender. With this option I would only really need about 6 or 7 planes (49 or sovertices total)

I baked this to a 2048x2048 texture, using a 2k texture of the leaf, yet it turns out completely pixalated. You could hardly tell its a leaf without context (unlike with your examples, you can tell its leaves and vines).

I went with the baking route because I am not at all proficient in graphics software like photoshop(and I think I googled it and its not possible to randomly scatter objects on the texture with photoshop). Even if I stretch the UV island to bounds inblender and bake it like that it turns out pixalated. It certainly is not as sharp as the 256x256 texture on a lot of planes like on 2nd picture.

I am not using lightning at all (which seems to pixalate results in blender bake) ..only baking DIFFUSE - COLOR. Did you texture your example in a graphics software or baked it?

I feel like I will go with the first option (scattered planes)..maybe tune down the amount of leaves. The med->low distance is 46m, so I can make LOD1 and LOD0 a single triangle (doesnt need to be visible at this distance). It is 1LI this way too. The problem would be if someone wants to make the mesh larger and in that case it would be 2LI for just the leaves.

I dont know why I am so inclined to make the LI as lowest as possible. 

Link to comment
Share on other sites

2 hours ago, arisaie said:

Yes exactly ChinRey. I meant a surface covered in leaves.

Thank you for your detailed explanation.

I intend to add autumn(leaves fallen on surface) and winter(snow cover on surface) option to my mesh. Just a few of the leaves scattered around the mesh and the ground.

The problem is with the baked resolution of the leaves. Your example looks much better.ex1_001.thumb.png.3f6302f66d6e666496741a11a714a019.png

Here is a picture of how I would imagine it. (theres more above) This is done with blender geometry nodes where planes are scattered across my mesh. Each plane uses the same material -  256x256 pixel image of a leaf. The problem with this it adds up to more than 1400 vertices. And I had to make LOD1 and LOD0 to a single triangle otherwise the LI goes to 3.8.

ex2_001.thumb.png.9deacb5013280bcef8fe54f797594947.png

This is the closeup of leaves on individual planes.

ex3_001.thumb.png.e50d73e667d4dfb1e13ddf54191af599.png

And this is how the baked texture looks if I bake the individual leaves to a singular plane in blender. With this option I would only really need about 6 or 7 planes (49 or sovertices total)

I baked this to a 2048x2048 texture, using a 2k texture of the leaf, yet it turns out completely pixalated. You could hardly tell its a leaf without context (unlike with your examples, you can tell its leaves and vines).

I went with the baking route because I am not at all proficient in graphics software like photoshop(and I think I googled it and its not possible to randomly scatter objects on the texture with photoshop). Even if I stretch the UV island to bounds inblender and bake it like that it turns out pixalated. It certainly is not as sharp as the 256x256 texture on a lot of planes like on 2nd picture.

I am not using lightning at all (which seems to pixalate results in blender bake) ..only baking DIFFUSE - COLOR. Did you texture your example in a graphics software or baked it?

I feel like I will go with the first option (scattered planes)..maybe tune down the amount of leaves. The med->low distance is 46m, so I can make LOD1 and LOD0 a single triangle (doesnt need to be visible at this distance). It is 1LI this way too. The problem would be if someone wants to make the mesh larger and in that case it would be 2LI for just the leaves.

I dont know why I am so inclined to make the LI as lowest as possible. 

If you use scattered planes then you could lower the number of required polygons by grouping leaves together on the texture for each plane, preferably by creating all the leaf groups on a single 512x512 texture (or 1024x1024 if you need the additional resolution) then arranging the UV mapping for the planes so that each plane shows different portions of the texture in order to make the leaf fall look more random and natural.

ETA(Part I): Essentially when you're baking textures (whether it be branches on a tree or leaves on the ground) it's always best to try and reuse textures as much as possible rather than trying to bake a unique texture for each part, especially when dealing with hundreds of smaller objects like leaves, since it's unlikely that anyone is going to notice whether each leaf is unique no matter how closely they look.

ETA:(Part II & III): I know a lot of people obsess over LI and it's always good to try and optimize both your mesh and textures as much as possible, but I'd suggest not letting land impact play too much of a part in your creative process or decision making.  It's better to create something which looks good at any LOD it's likely to be viewed in (I emphasize this because for objects that are in enclosed spaces discarding the lower LOD models in favour of a single triangle is perfectly acceptable) and have it come out at a slightly higher LI than achieve the lowest LI possible and have it crumple into a mangled polygonal mess when viewed from a certain distance.

As for texturing, LL are currently working on a new viewer which will enable materials for all residents so although most may not be using them at the moment soon everybody will be able to see them, so consider using materials to create your leaf textures, etc. because they can turn a flat texture like this...

(I posted these pics in another thread recently but since they're particularly relevant to the topic I'll  post them again here)

image.jpeg.da015b1d22d8f5e6cd373b06aaa4da91.jpeg

into seemingly 3D objects like this...

image.gif.99901ea9c73ffd0d8f4162e935c5b769.gif

 

Edited by Fluffy Sharkfin
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

6 hours ago, arisaie said:

I went with the baking route because I am not at all proficient in graphics software like photoshop(and I think I googled it and its not possible to randomly scatter objects on the texture with photoshop). Even if I stretch the UV island to bounds inblender and bake it like that it turns out pixalated.

You should try to use a mid level graphics program like paint.net. It's far more user friendly than Photoshop and Gimp and it still has nearly all the functions you actually need for SL textures. I haven't used Photoshop for years myself since I'm allergic to pay-per-month software. I do use Gimp for operations paint.net can't do but I hardly ever need it - it doesn't even happen every year.

You are right that a image editor won't scatter objects randomly for you but it's not really that difficult to do it manually, just make a bunch of copies of a layer with a single leaf or a small group of them and move, rotate and resize each layer. An additional advantage to doing it manually is that you can add some discreet perlin noise shading to each layer - an amazingly effective way to add life and depth to the texture. I'm forever grateful to JubJub Forder for teaching me that last trick.

Any reasonably advanced image editor have to crucial functions that Blender lacks as far as I know. One is the option to color the transparent parts of the texture. The black outline of your leaves are caused by the color of the transparent pixels bleeding onto the opaque ones. If you look at the last picture in my post, where alpha mode is set to none, you see that the alpha color is green, similar to the leaves themselves.

The other is that they offer a variety of scaling algorithms. There are several ways pixels can be combined or split when an image is resized and which method you choose can make a huge difference to the apparent image resolution. (Paint.net actually has an advantage here since it supports Fant, a very advanced and useful scaling algorithm that Photoshop and Gimp can't support.)

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

19 hours ago, arisaie said:

I baked this to a 2048x2048 texture, using a 2k texture of the leaf, yet it turns out completely pixalated. You could hardly tell its a leaf without context (unlike with your examples, you can tell its leaves and vines).

The maximum texture size in SL is 1024x1024, even if you managed to upload a larger texture.

If you stretch that texture to cover an area of 10 meters, you only get about 100² pixels per meter, which is... not a lot. A small leaf would only get a few pixels to itself. Your smallest leaves look like they're occupying about 6x6 pixels...

That's why you should consider creating multiple reusable leaf patterns and applying those to individual planes which cover a decent area. That's the way to balance resolution vs topology in this case. (Not that 1400 vertices are anything to be concerned about.)

Edited by Wulfie Reanimator
  • Like 2
Link to comment
Share on other sites

Ooook...so after trying different algorhitms  and trying to understand why pixels are so damn big I came to a conclusion that the best way is to create a texture pattern as all three of you said and overlay the UVs after. The texture stretches indifinetely and its possible to move the UVs around outside the 1 -1 UV space. 

I managed to create an OK texture like like this.

 

Thanks Fluffy, ChinRey and Wulfie, all your information were certainly informative!

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 557 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...