private void RegenerateLightingLut() { if (penumbraLut == null || penumbraLut.width != 1 || penumbraLut.height != 64) { SgtHelper.Destroy(penumbraLut); penumbraLut = SgtHelper.CreateTempTeture2D(1, 64); } for (var y = 0; y < penumbraLut.height; y++) { var t = y / (float)penumbraLut.height; var a = PenumbraBrightness.Evaluate(t); var b = PenumbraColor.Evaluate(t); var c = a * b; c.a = c.grayscale; penumbraLut.SetPixel(0, y, c); } // Make sure the last pixel is white penumbraLut.SetPixel(0, penumbraLut.height - 1, Color.white); penumbraLut.wrapMode = TextureWrapMode.Clamp; penumbraLut.Apply(); }
private void RegenerateRimLut() { if (rimLut == null || rimLut.width != 1 || rimLut.height != 64) { SgtHelper.Destroy(rimLut); rimLut = SgtHelper.CreateTempTeture2D(1, 64); } for (var y = 0; y < rimLut.height; y++) { var t = y / (float)rimLut.height; rimLut.SetPixel(0, y, RimColor.Evaluate(t)); } rimLut.wrapMode = TextureWrapMode.Clamp; rimLut.Apply(); }
private void RegenerateLightingLut() { if (lightingLut == null || lightingLut.width != 1 || lightingLut.height != 64) { SgtHelper.Destroy(lightingLut); lightingLut = SgtHelper.CreateTempTeture2D(1, 64); } for (var y = 0; y < lightingLut.height; y++) { var t = y / (float)lightingLut.height; lightingLut.SetPixel(0, y, LightingBrightness.Evaluate(t) * LightingColor.Evaluate(t)); } lightingLut.wrapMode = TextureWrapMode.Clamp; lightingLut.Apply(); }
protected virtual void RegenerateAtmosphereLut() { if (atmosphereLut == null || atmosphereLut.width != 1 || atmosphereLut.height != 64) { SgtHelper.Destroy(atmosphereLut); atmosphereLut = SgtHelper.CreateTempTeture2D(1, 64); } for (var y = 0; y < atmosphereLut.height; y++) { var t = y / (float)atmosphereLut.height; atmosphereLut.SetPixel(0, y, DensityColor.Evaluate(t)); } atmosphereLut.wrapMode = TextureWrapMode.Clamp; atmosphereLut.Apply(); }