Page 1 of 1

Bakery's Vertex Lit Lightmaps and ASE shaders

PostPosted: Fri Jan 18, 2019 11:54 am
by mehran
Hi,
I am using bakery, which is a lightmapping plugin for unity. One of it's features is to provide vertex-color Lightmaps.
But those need to be supported inside of shaders.
I wanted to ask how I can have those supported in my ASE shaders.
here is the reply I got from the author of bakery
you can take a look at ftSimpleVertexLM.shader included in Bakery. This is a simplest unlit shader using vertex lightmaps, so should be easy to understand how it works.
Basically you just read vertex color and decode using this formula:

// Decode baked HDR vertex color (RGBM)
o.color = v.color.rgb * v.color.a * 8.0;
o.color *= o.color;

o.color can be now used as final lighting value.


any chance you guys can support this inside of ase as well?
thanks

Re: Bakery's Vertex Lit Lightmaps and ASE shaders

PostPosted: Sat Jan 19, 2019 8:18 am
by CaptainHexagon
If it modifies the vertex color of the mesh, Then I believe all you need to do is to reroute that value through your shader. to do so you can just add a "Vertex Color" node and multiply that over your texture sampler or whatever you have.

I noticed that he is using simple math to convert the HDR to normal values. this is simple here is an example https://imgur.com/a/JkyuRmi

Just do the same.

Let me know if this helped.

Re: Bakery's Vertex Lit Lightmaps and ASE shaders

PostPosted: Mon Jan 21, 2019 8:05 am
by mehran
thanks man,
I will try that.
but I want to be able to use this as a regular light map, on pbr shaders with realtime lighting and all, is that possible?

Re: Bakery's Vertex Lit Lightmaps and ASE shaders

PostPosted: Thu Jan 24, 2019 3:49 pm
by Amplify_Borba
Hello! I'm not at all familiar with Bakery myself, you might be able to integrate it as in this example, in order to access its specific functions.

We can't officially support 3rd party shaders or assets, but we've worked with other developers in order to assist them with adding ASE-built shaders or custom nodes, which are included in their packages and maintained by them.