Search Issue Tracker
Fixed
Votes
1
Found in
4.5.0f6
Issue ID
613476
Regression
No
Using ViewDir in custom Lightmap functions in shaders doesn't work
Open the project.
Observe the two pink spheres
The sahders on these spheres try and use custom lightmap functions including the optional viewDIr. For some reason they error out with
'expression left of ."viewDir" is not a struct or array'
The original thread can be found here, and where Aras has requested this be submitted as a bug.
http://forum.unity3d.com/threads/custom-lightmapping-viewdir-seems-to-be-broken.251393/
According to this page using an optional ViewDir in the custom lightmap function paramaters should work (decode lightmaps)
http://docs.unity3d.com/Manual/SL-SurfaceShaderLighting.html
The ToneMapLightmap shader in the supplied project uses the shader found here
http://docs.unity3d.com/Manual/SL-SurfaceShaderLightingExamples.html
which works, but once you add viewDir to it fails.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Add comment