I’m playing with the incredible Kite Demo PDO billboard technique, and am getting nice deep shadows on my meshes- however it seems that I have to manually align the billboard using a size parameter that is connected to the ImposterUVs node. After I get it more or less flush with the original highres mesh, it LODs nicely at a scale of 1, but as soon as I scale it, the billboard stays at the same size. Is there a way to dynamically scale the billboard with the mesh? This is vital if having a foliage asset that has scale variations in a level. Thanks!
In the Kite demo, I solved this in a rather unfortunate way. I used transform 0,0,0 local->world and then transform 1,1,1 local-> world. Then you get the distance between those two. Then this defines your mesh mesh scale variance. Then you still need to measure the size of the mesh when scaled to 1.0 and multiply by that, and it should stay relative.
There may have been another step of doing this on the customUVs but I honestly can’t recall if that was necessary. My rule of thumb for that is: try it on the pixel shader and if it doesnt work, try it on the vertex shader
Thanks for the info! I have tried to figure this out but wasn’t sure of some of the steps. I referenced the billboard shader in the Kite Demo download and it seems the imposter billboard used there doesn’t scale with the asset either. Would there be a simpler way to set up the nice depth effect without using the imposter UVs node- for example on a custom simple crossplane billboard with all correct input maps baked? I’m more interested in getting the distant shadowing to look correct on a billboard than imposters right now, and this technique seems to blow everything else I’ve tried away! Thanks.
It should have been in there and should have scaled. That was the only material i did that for. It was probably buried in the customUVs so it could have been easy to miss.
There is a chance that two copies of that material made it in somehow.
I found the problem in the MaterialFunction “/Engine/Functions/Engine_MaterialFunctions01/WorldPositionOffset/FoliageScaleFactor”. The problem is also in 4.14 preview.
Both of the TransformPosition nodes are set to output Local Space, the same as the inputs. Change their Destination to output Absolute World Space. This fixes the problem of the mesh instances scaling with the billboard sizes correctly.
This worked perfectly. Thank you so much! I thought I was going crazy as I had everything set up identically! Much appreciated.
Nice catch! That is a pretty obscure bug that is hard to notice.