+28
Wird überprüft
Lightmap support for Custom Lighting Shader
It would be nice to have a non gray out checkbox for Lightmap support under the lighting tab like with Bling-Phong for the Custom Lighting...
Or maybe a tutorial on how to decode lightmap with custom lighting would be great!
Or maybe a tutorial on how to decode lightmap with custom lighting would be great!
Customer support service by UserEcho
Should lightmapping simply always be a replacement for light direction and light color, or should they be separate nodes?
Vertex Input Struct :
#ifdef LIGHTMAP_ON
half4 texcoord1 : TEXCOORD1;
#endif
Frag Input Struct :
#ifdef LIGHTMAP_ON
half2 uv2 : TEXCOORD1;
#endif
Shader Variables :
#ifdef LIGHTMAP_ON
fixed4 unity_LightmapST;
sampler2D unity_Lightmap;
#endif
Vert Function :
#ifdef LIGHTMAP_ON
o.uv2 = v.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw;
#endif
Frag Function :
#ifdef LIGHTMAP_ON
fixed3 lightmap = DecodeLightmap(tex2D(unity_Lightmap, i.uv2));
// execute whatever you want to do with lightmap here
#endif
However, it would have to handle the fact that LIGHTMAP_ON might be false.
float3 lightmap = float3(1, 1, 1);
#ifdef LIGHTMAP_ON
lightmap = DecodeLightmap(tex2D(unity_Lightmap, i.uv2));
#endif
//do whatever
the user could even choose the default color
However, mind that lightmapping is not only a single lightmap decode.
For single lightmaps - yes, that's pretty much it.
But not for dual lightmaps, and not for directional lightmaps.
Dual lightmaps need to handle the blend between direct LM without RT lights, and direct RT lights without direct LM.
Directional lightmaps need to have a separate output for its light direction, which also brings forth a few design issues as well as implementation quirks.
In addition, it needs to handle HDR vs LDR, as well as all of this in deferred rendering in addition to forward rendering
Joachim, if it's not too much to ask, would you mind giving a basic run-down of what's changed/why it's more complicated?
The problem arises when you want to do something, well, other than that. Their structures is still what keeps the entire pipeline running and if you want to break that pipeline out, you have to backtrack all of that code and filter everything for what you need. PBR is very, intertwined, in a way, because for instance, you have to have specularity, PBR doesn't make sense without it. But in Shader Forge, you can choose not to use it. But then you want to still access lightmaps built for a PBR pipe.
Another issue is that lightmapping has several types, which require branching, and custom branching is currently not supported in SF. The most complicated one is the directional lightmapping, which needs to run the entire BRDF twice, which SF doesn't support either.
I really wish that we had known that it didn't work... this is a great disappointment.
WAIT... Not supported? I thought that's my fault that breaks my custom shaders, until I find this post. Any updates will be appreciated.
Mind that this applies only to custom lighting, and the directional specular lightmap mode. Other than that, lightmapping in SF for non-custom-lighting shaders should work.
Hi, I'm following this tutorials about view direction based lighting (http://acegikmo.com/shaderforge/wiki/index.php?title=View-Direction_Based_Lighting) and the final shader looks great in game. Soon I found I can't use baked point light to light up my scene. After your reply, I realize that we may not be able to bake "View Direction Based" shaders in anyway in fact, is that right?
I've always dreamt of winning BIG in the lottery. I surfed the internet for help to win the lottery massively and I was directed to the DR Amber website. I had a chat with him about what I needed and he assured me that his spell will make me become a lottery winner. He got back to me after 3 days with the numbers that I needed to play the lottery and told me to believe in myself. I felt enveloped by the control of the spell. I took his words and played the Mega Millions Lottery. Two days later, I was sent an email that I've won the sum of 107 Million Dollars. I was shocked and couldn't believe what my eyes were seeing. Immediately I was given the cash prize, I stopped working. I want to say a very big thank you to DR Amber for helping people like us who really need help. Now I know that there's absolutely nothing too hard for DR Amber to do. To get in touch with him, email : [ amberlottotemple@yahoo.com ] or click his webpage URL___ amberlottotemple.com
Contact Dr. Excellent for relationship problems!!
Everything I’m going to suggest for you is what I’ve seen breathe new life into broken marriages for thousands of women in your distressing situation—and what I did to revitalize my own broken marriage. I was heart broken when my husband left me and moved to California to be with another woman. I felt my life was over and my kids thought they would never see their father again. I tried to be strong just for the kids but I could not control the pains that tormented my heart, my heart was filled with sorrows and pains because I was really in love with my husband. I have tried many options but he did not come back, until i met a friend that directed me to Dr. Excellent a spell caster, who helped me to bring back my husband after 11hours. Me and my husband are living happily together again, This man is powerful, Contact Dr. Excellent for any kind of spiritual problems or any kind of spell or relationship problems he is capable of making things right for you with no side effect. Here his contact. Call/WhatsApp him at: +2348084273514 "Or email him at: Excellentspellcaster@gmail. com , His website:https://lovespellonline.godaddysites.com