Amerio.Stephane Posted July 17, 2020 Share Posted July 17, 2020 (edited) Hello, Is it possible to have an alpha-blended material whose transparency multiplier/transparency pow are controlled by the distance to the camera? Can we write an expression in the surface material parameters with the camera distance as an input? Or should I go with a new shader? (but how to get the eye distance?) (note: this is for a loooong cable material. I tried using the LOD fade but the result is not convincing, the transparency+wire inflation turns out really better in the distance) Thanks! Edited July 17, 2020 by Amerio.Stephane Link to comment
silent Posted July 17, 2020 Share Posted July 17, 2020 Hi Stephane, You can control all of the material parameters via code (C++ / C# / UnigineScript), so you simply need to write a custom logic that will change transparency multiplier based on some calculated value. No additional shader is required. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Amerio.Stephane Posted July 17, 2020 Author Share Posted July 17, 2020 Hi Silent, I already though about this, but I fear this could be too costly (not tested, though). I have more than 10.000 cables. Won't adding a component/update for each of them be too much? (I'll try, nothing beats manual timing in the end) Thanks! Link to comment
silent Posted July 17, 2020 Share Posted July 17, 2020 If these meshes are identical you can use MeshCluster to increase the performance a bit. You also can perform visibility checks per object group and spread the 10.000 objects update for 60 or more frames to reduce the overall peak load. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
ulf.schroeter Posted July 18, 2020 Share Posted July 18, 2020 Sounds like some fragment-shader-based approach could both provide muuch better quality (per-pixel distance fade) and performance (batching 10000 instances using same cable material into much fewer batches) Link to comment
Recommended Posts