Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit aa6aee4

Browse files
authored
Merge pull request #206 from huangdonghai/v1
fix dx9 shader model 3 linear rendering DoF bug
2 parents bb568c4 + d0239ff commit aa6aee4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

PostProcessing/Runtime/Components/DepthOfFieldComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public void Prepare(RenderTexture source, Material uberMaterial, bool antialiasC
105105
material.SetFloat(Uniforms._RcpAspect, 1f / aspect);
106106

107107
// CoC calculation pass
108-
var rtCoC = context.renderTextureFactory.Get(context.width, context.height, 0, cocFormat);
108+
var rtCoC = context.renderTextureFactory.Get(context.width, context.height, 0, cocFormat, RenderTextureReadWrite.Linear);
109109
Graphics.Blit(null, rtCoC, material, 0);
110110

111111
if (antialiasCoC)

PostProcessing/Runtime/Utils/RenderTextureFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public RenderTexture Get(RenderTexture baseRenderTexture)
2727

2828
public RenderTexture Get(int width, int height, int depthBuffer = 0, RenderTextureFormat format = RenderTextureFormat.ARGBHalf, RenderTextureReadWrite rw = RenderTextureReadWrite.Default, FilterMode filterMode = FilterMode.Bilinear, TextureWrapMode wrapMode = TextureWrapMode.Clamp, string name = "FactoryTempTexture")
2929
{
30-
var rt = RenderTexture.GetTemporary(width, height, depthBuffer, format);
30+
var rt = RenderTexture.GetTemporary(width, height, depthBuffer, format, rw); // add forgotten param rw
3131
rt.filterMode = filterMode;
3232
rt.wrapMode = wrapMode;
3333
rt.name = name;

0 commit comments

Comments
 (0)