cppctamber / ccpwgl2

ccpwgl2
MIT License
27 stars 5 forks source link

Feature / Dust, dirt and aging #100

Open cppctamber opened 3 years ago

cppctamber commented 3 years ago

The tranquility and sisi v5 gles shaders never supported dust or dirt functionality (that I saw). At one stage (some time around 2015?) the Chaos server contained a quadv5.sm_hi shader that did have the functionality although it wasn't working, but I was able to fix it. Unfortunately this file was lost when I destroyed the original caldariprimeponyclub website (oops!).

cppctamber commented 3 years ago
function calculateAge(weeksSinceCleaned)
{
    return 0.7 - 1.0 / (Math.pow(weeksSinceCleaned, 0.65) + (1.0 / 2.7));
};

function setAge(wrapped, dirtLevel)
{
    wrapped._perObjectData.perObjectPSData.data[2] = dirtLevel;
};