浏览代码

Fixed issue in test framework that was incorrectly blending alpha. Fixed issue in specular of simple lighting shader.

/Add-support-for-light-specular-color-tint
Felipe Lira 7 年前
当前提交
5224d3ba
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 2
      ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightPassLit.cginc
  2. 2
      Tests/GraphicsTests/Framework/Editor/TestFramework.cs

2
ScriptableRenderPipeline/LightweightPipeline/Shaders/LightweightPassLit.cginc


half fogFactor = IN.fogFactorAndVertexLight.x;
#if defined(_SPECGLOSSMAP) || defined(_SPECULAR_COLOR)
half4 specularGloss = SpecularGloss(uv, alpha);
half4 specularGloss = SpecularGloss(uv, diffuseAlpha.a);
return LightweightFragmentBlinnPhong(positionWS, normalWS, viewDirectionWS, fogFactor, diffuseGI, diffuse, specularGloss, shininess, emission, alpha);
#else
return LightweightFragmentLambert(positionWS, normalWS, viewDirectionWS, fogFactor, diffuseGI, diffuse, emission, alpha);

2
Tests/GraphicsTests/Framework/Editor/TestFramework.cs


// Readback the rendered texture
var oldActive = RenderTexture.active;
RenderTexture.active = tempTarget;
var captured = new Texture2D(tempTarget.width, tempTarget.height, TextureFormat.ARGB32, false);
var captured = new Texture2D(tempTarget.width, tempTarget.height, TextureFormat.RGB24, false);
captured.ReadPixels(new Rect(0, 0, testSetup.width, testSetup.height), 0, 0);
RenderTexture.active = oldActive;

正在加载...
取消
保存