Skip to content

Commit

Permalink
fix to render texture format
Browse files Browse the repository at this point in the history
  • Loading branch information
slipster216 committed Oct 22, 2020
1 parent f3df24b commit 6def402
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 34 deletions.
6 changes: 3 additions & 3 deletions Materials/DistortionRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ void EnforceCamera()

if (distortionRT == null)
{
distortionRT = RenderTexture.GetTemporary(Screen.width / (int) factor, Screen.height / (int) factor, 0);
distortionRT = new RenderTexture(Screen.width / (int) factor, Screen.height / (int) factor, 0, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear);
}
else if (distortionRT.width != Screen.width / (int) factor ||
distortionRT.height != Screen.height / (int) factor)
{
RenderTexture.Destroy(distortionRT);
distortionRT = RenderTexture.GetTemporary(Screen.width / (int) factor, Screen.height / (int) factor, 0);
distortionRT = new RenderTexture(Screen.width / (int) factor, Screen.height / (int) factor, 0, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear);
}

distortionRT.wrapMode = TextureWrapMode.Clamp;
Expand All @@ -62,7 +62,7 @@ private void OnDisable()
{
if (distortionRT != null)
{
//RenderTexture.Destroy(distortionRT);
RenderTexture.Destroy(distortionRT);
}

if (effectCamera != null)
Expand Down
2 changes: 1 addition & 1 deletion PPV2/PPVolume Profile.asset
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ MonoBehaviour:
value: 1
scale:
overrideState: 1
value: 0.091
value: 0.0494
61 changes: 31 additions & 30 deletions PPV2/pp2_example.unity
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 19851885}
m_LocalRotation: {x: -0.002498239, y: 0.9947568, z: -0.09911575, w: -0.025073268}
m_LocalPosition: {x: 0.6810328, y: 2.4238636, z: 1.2470474}
m_LocalRotation: {x: -0.000018872555, y: 0.9998674, z: 0.016188996, w: 0.0018006602}
m_LocalPosition: {x: -0.15624666, y: -0.123598695, z: 4.295494}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
Expand All @@ -316,7 +316,7 @@ GameObject:
- component: {fileID: 95850208}
- component: {fileID: 95850207}
m_Layer: 9
m_Name: Quad
m_Name: distortionEffect
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -391,11 +391,11 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 95850206}
m_LocalRotation: {x: 0, y: 1, z: 0, w: -0.00000016292068}
m_LocalPosition: {x: 0, y: 3.01, z: -2.81}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 5, y: 5, z: 5}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &210227022
GameObject:
Expand Down Expand Up @@ -535,37 +535,37 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &892762036
--- !u!1 &1808394311
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 892762040}
- component: {fileID: 892762039}
- component: {fileID: 892762038}
- component: {fileID: 892762037}
- component: {fileID: 1808394315}
- component: {fileID: 1808394314}
- component: {fileID: 1808394313}
- component: {fileID: 1808394312}
m_Layer: 0
m_Name: Cube
m_Name: background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &892762037
--- !u!23 &1808394312
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 892762036}
m_GameObject: {fileID: 1808394311}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
Expand Down Expand Up @@ -595,38 +595,39 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!65 &892762038
BoxCollider:
--- !u!64 &1808394313
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 892762036}
m_GameObject: {fileID: 1808394311}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &892762039
serializedVersion: 4
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &1808394314
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 892762036}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &892762040
m_GameObject: {fileID: 1808394311}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1808394315
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 892762036}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.16, z: -6.41}
m_GameObject: {fileID: 1808394311}
m_LocalRotation: {x: 0, y: 1, z: 0, w: 0}
m_LocalPosition: {x: 0, y: 0, z: -0.35}
m_LocalScale: {x: 5, y: 5, z: 5}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}

0 comments on commit 6def402

Please sign in to comment.