After converting all HDRP/Lit to Better Lit/Lit I experimented around a bit. Quite interesting what you can achieve with just layering and fading materials:
OK, so just so I have this straight…
When using the “fastest” texture packing option…
create a texture by…
Bake textures in blender…
Open Photoshop create new 16bit RGB document
open bakes and copy and paste each image into these channels on the new doc:
Baked Norm Red - Alpha Packed
Baked Norm Green - Green Packed
Baked Smooth - Red Packed – White is shiny black is matte
Baked AO - Blue Packed
Baked Color Red - Albedo Red
Baked Color Green - Albedo Green
Baked Color Blue - Albedo Blue
Baked Height - Albedo Alpha
EXPORT them in photoshop to TIFF 16bit
Import in Unity and uncheck sRGB
I feel like something is wrong in this process because when i uncheck sRGB my red green and blue channels get wiped (they are solids colors in the respective channel previews)
Well you don’t need to do 16bpp files, Unity has limited support for 16 bit per channel data and squashes them down to 8bpc anyway. I’d just use a 32bit targa.
Oh i see thanks. I had heard somewhere that normal maps should be 16bit, heightmaps 32 or something like that…
Hmm, take a look at the Triplanar UVs in Local mode for the layer 0 texture. Lighting appears to be inverted or shifted by about 45 degrees. The world space triplanar UVs are fine though.
Interesting, I’ll check that out - does it move with the object rotation?
Yep its does. As if a directional light were a child of the object.
Sorry to pile on the problems but it looks like the alpha mode is not working right as well. I have a gradient from black to white in the alpha channel of the albedo texture, set the shader to alpha mode and the whole model goes to about 50% opacity.
I added Standard an URP converters in addition to the HDRP converter:
In case you need to have finer granular conversion feel free to modify these classes and create pull requests.
Hi, which variants are not compatible? Or rather what settings/features cause those variants?
Hey Jason,
I’m looking to get the highest quality baked lightmap that can run on older machines (historical settings in schools … shadowmask so almost everything is lightmapped, with a few dynamic objects in there using light probes + real time shadows). I’m looking at using this with Bakery to handle different weather types + grunge in an efficient way. However, I’m also curious about using Bakery’s Spherical Harmonics, since they claim that’s the best quality.
Is there any way this can work with that? They have a custom shader, but it would be fantastic if somehow that were able to be used in this as well. From their documentation: “RNM and SH can be only used with Bakery shader or require adjustments to your shaders”.
Thanks!
We’re working on a bakery integration right now, actually. Should be out soon.
Wow, thank you so much. That’s awesome!
Also, just curious since this has to run on older hardware. If no extra stuff is turned on, is this actually more performant (or at least comparable) than the built in standard pbr shader? Are things like snow / wetness relatively cheap, or weathering? Basically, just making sure this wont be much more taxing than using the standard shader or using ASE to do a few minor effects myself.
Thanks again.
lol, i dont think anyone is capable of writing more efficient shaders than jbooth my dude…
Sorry for the questions.
Is it possible to achieve the shape/trails of snow in this using the snow layer, or does that only use noise and this would need to be done using texture layers? Is this something I should be using microsplat for (dynamic snow there)? Im assuming performance on this is a lot better.
Thank you.
[Edit – after thinking about this, I suspect I should just use microsplat + my own terrain layer for snow, so I have more control, as well as to muddy things up where needed … but still curious if this can be done with this.]
Generally more performant based on just the texture packing. A full PBR texted surface in the Lit/Standard shader is 4-5 textures, where it can be done in 2 or 3 in Better Lit, saving significant bandwidth.
There isn’t any kind of “painted” layer for snow coverage. You could do snow using two texture layers though instead of using the dynamic system if you wanted to carefully paint coverage though.
I’m using microsplat + this for non terrain. Its working well so far.
Would it be possible to add a checkbox for disabling/enabling Unity Fog for the shader?
I think I read this shader is sm3…? Has anyone used it in webGL2. Is it compatible?
Hi, sorry for another question.
How do I use this with AssetBundles? When I load my ab, the material is pink. If I try to always include the shader in the build, it yells about shader variants. If I just use the standard material, everything comes in fine.
Not sure what I’m really doing here with this. Any ideas? The same goes for microsplat terrain …
The following is the error I get when trying to build an AssetBundle with this added to the always include shader: “Better Lit/Lit has too many Shader variants(4827858800541171712).To resolve this, go to Project Settings > Graphics and remove this Shader from the Always Included Shaders list.For more explicit control over how Unity includes specific Shader variants in a build, use a ShaderVariantCollection.”.
Is there an easy way to fix this, or am I not able to use this in the end because of this?