Hi, I want to use RenderTextures as lightmaps… I tried going through all materials and setting “_LightMap” to my RenderTexture, but that’s only for the old legacy lightmapping shaders… the new lightmap system is using “unity_Lightmap” in the shaders, but thats not exposed as a material property.
So, I thought I could do the lightmapping lookup myself, but I want to keep all the builtin shaders and just add this extra part (and switch off the old lightmapping lookup/decode). Does anyone know the easiest way of doing this, other than making a copy of all the shaders and changing #pragmas etc (if thats how I would go about it) ?
Thanks, Chris.
Unfortunately, lightmaps must be Texture2Ds. They are assigned in LightmapSettings and referenced by index by each Renderer.
Hi Daniel, You are right, they are as Texture2D’s in the LightmapSettings array, but unity internally just copies those out and passes them to the shaders as Textures (into the “unity_Lightmap” texture thats in each shader)… so I need to somehow bypass that and make a new lookup using my own Texture, eg: MyLMTex or something… but I want to add this extra part to all of the builtin shaders and switch the old unity lightmap lookup OFF somehow… Pretty sure I can do it by hand editing every single shader, but just wondering if there was a quicker way of adding something to all shaders than doing them 1-by-1 
Incidentally, looking at yr location
… do you know if the GMA950 has render-to-texture support? Just wondering as it’s the main GPU in laptops these days…
Unfortunately, I think editing all the shaders you need to use is your only option in this case.
GMA950 supports all sorts of things, including render-to-texture (it is technically a Shader Model 2.0 chipset) but it does most of them very slowly.
Thanks, good news about the GMA950 at least, looks like I’ll have to do the shaders by hand, oh well! 