Hi
Recently i started building my levels and baking lights and i have come across this lighting issue when baking on a locally tiled texture, the model is a simple plane but its not affected by model type as others seem to have the same issue.
Im using the setup as pictured below.
I also tried a variation of object scale with x and y appended and multiplied with tex coord that has the same result as shown here but still no improvement on baked lights.
Now it says the object scale doesnt work with the pixel shader but ive tried varius combinations of everything i could find online but nothing worked, tried utilizing customized uvs but also no gain.
Dont want to use object radius as it only scales correctly when scaling uniformly and specifically dont want to use the world aligned texture as im using it on another master material which has different uses than this one.
This material is important as i can scale it as i want and it keeps the look no matter of position.
Any help is appreciated
On a sidenote
Im having also issues with two sided materials and light baking as the plane im using is a simple two tris plane and it is not exported as solidified so the normals are only facing upwards from the floor.
I also use the plane as walls where needed etc but the problem when baking light is that the backface does not get illuminated although the material is twosided and it shows the texture both front and back.
Shouldnt the two sided material invert normals for the back side?
Thank you.
If you want to use object scale in the pixel shader add a vector parameter called ObjectScale to your material. Right click on your static mesh, under Asset Actions, select Create Blueprint Using This. In the construction script, create a material instance dynamic with the desired material as parent. Get world scale of the static mesh component. Set vector parameter value for ObjectScale, targeting your dynamic material instance.
That would defeat the purpose of the material, the point was for it to be simple and quick to use.
Ok ignore the pixel shader, is there any way to set up the material so it does not have the light bake artifacts, or is there a way to set up the world aligned texture so it moves with the plane and is not projected.
I need the material i can scale the object with it that would move with the object.
Sorry, here I thought the purpose of the material was to look how you wanted it to. Once you have a single actor like the one described, you can easily duplicate it and just change the referenced static mesh component and material of the root component. As long as all the scalable materials have a parameter with the same name, no other changes are necessary.
What do you mean by “is not projected”?
Perhaps wrong wording, meant to say that when you move the object the texture is constant in world space so the object receives different parts of the texture as the object moves
What i need is a way to get the world aligned texture to move with the object so that the object only expands on the texture as it scales, ie that setup posted above but with correct baked lighting as the world aligned node has in a material
To summarize; the posted setup works but has lighting artifacts with static light on textures with pronounced normals( the uvs of the texture get stretched when lighting is baked so it shows shadows where there should be no shadows according to the texture shown in the viewport ie the hole is on one location and its shadow on another, world aligned doesnt have this problem) and im looking for a way to fix the lighting issue
or i need a way to get the world aligned node in the material act as the posted setup above so the texture moves with my object
Update:
Fixed, posting solution for reference and in case anyone needs.
Text coord 1 also goes into the texture sample uvs