Skip to content

Commit

Permalink
updates to StandardAssets/ImageEffects from project upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyOThan committed Feb 17, 2025
1 parent b6ff25a commit 0af3690
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 8 deletions.
8 changes: 8 additions & 0 deletions Unity/SCANsat/Assets/Editor/ImageEffects.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public override void OnInspectorGUI () {
// display info text when screen blend mode cannot be used
Camera cam = (target as BloomAndFlares).GetComponent<Camera>();
if (cam != null) {
if (screenBlendMode.enumValueIndex==0 && ((cam.hdr && hdr.enumValueIndex==0) || (hdr.enumValueIndex==1))) {
if (screenBlendMode.enumValueIndex==0 && ((cam.allowHDR && hdr.enumValueIndex==0) || (hdr.enumValueIndex==1))) {
EditorGUILayout.HelpBox("Screen blend is not supported in HDR. Using 'Add' instead.", MessageType.Info);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Unity/SCANsat/Assets/Editor/ImageEffects/BloomEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public override void OnInspectorGUI () {
// display info text when screen blend mode cannot be used
Camera cam = (target as Bloom).GetComponent<Camera>();
if (cam != null) {
if (screenBlendMode.enumValueIndex==0 && ((cam.hdr && hdr.enumValueIndex==0) || (hdr.enumValueIndex==1))) {
if (screenBlendMode.enumValueIndex==0 && ((cam.allowHDR && hdr.enumValueIndex==0) || (hdr.enumValueIndex==1))) {
EditorGUILayout.HelpBox("Screen blend is not supported in HDR. Using 'Add' instead.", MessageType.Info);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public override void OnInspectorGUI () {

Camera cam = (target as Tonemapping).GetComponent<Camera>();
if (cam != null) {
if (!cam.hdr) {
if (!cam.allowHDR) {
EditorGUILayout.HelpBox("The camera is not HDR enabled. This will likely break the Tonemapper.", MessageType.Warning);
}
else if (!(target as Tonemapping).validRenderTextureFormat) {
Expand Down
8 changes: 8 additions & 0 deletions Unity/SCANsat/Assets/Standard Assets.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void OnRenderImage (RenderTexture source, RenderTexture destination)

doHdr = false;
if (hdr == HDRBloomMode.Auto)
doHdr = source.format == RenderTextureFormat.ARGBHalf && GetComponent<Camera>().hdr;
doHdr = source.format == RenderTextureFormat.ARGBHalf && GetComponent<Camera>().allowHDR;
else {
doHdr = hdr == HDRBloomMode.On;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void OnRenderImage(RenderTexture source, RenderTexture destination)

doHdr = false;
if (hdr == HDRBloomMode.Auto)
doHdr = source.format == RenderTextureFormat.ARGBHalf && GetComponent<Camera>().hdr;
doHdr = source.format == RenderTextureFormat.ARGBHalf && GetComponent<Camera>().allowHDR;
else
{
doHdr = hdr == HDRBloomMode.On;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void OnRenderImage (RenderTexture source, RenderTexture destination) {
dx11bokehMaterial.SetVector ("_Screen", new Vector3(1.0f/(1.0f*source.width), 1.0f/(1.0f*source.height), internalBlurWidth));
dx11bokehMaterial.SetPass (2);

Graphics.DrawProceduralIndirect (MeshTopology.Points, cbDrawArgs, 0);
Graphics.DrawProceduralIndirectNow (MeshTopology.Points, cbDrawArgs, 0);

Graphics.Blit (dest2, destination); // hackaround for DX11 high resolution flipfun (OPTIMIZEME)

Expand Down Expand Up @@ -329,7 +329,7 @@ void OnRenderImage (RenderTexture source, RenderTexture destination) {
dx11bokehMaterial.SetTexture ("_MainTex", dx11BokehTexture);
dx11bokehMaterial.SetVector ("_Screen", new Vector3(1.0f/(1.0f*rtLow2.width), 1.0f/(1.0f*rtLow2.height), internalBlurWidth));
dx11bokehMaterial.SetPass (1);
Graphics.DrawProceduralIndirect (MeshTopology.Points, cbDrawArgs, 0);
Graphics.DrawProceduralIndirectNow (MeshTopology.Points, cbDrawArgs, 0);

// upsample & combine
dofHdrMaterial.SetTexture ("_LowRez", rtLow2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void OnRenderImage (RenderTexture source, RenderTexture destination) {
sunShaftsMaterial.SetVector ("_SunThreshold", sunThreshold);

if (!useDepthTexture) {
var format= GetComponent<Camera>().hdr ? RenderTextureFormat.DefaultHDR: RenderTextureFormat.Default;
var format= GetComponent<Camera>().allowHDR ? RenderTextureFormat.DefaultHDR: RenderTextureFormat.Default;
RenderTexture tmpBuffer = RenderTexture.GetTemporary (source.width, source.height, 0, format);
RenderTexture.active = tmpBuffer;
GL.ClearWithSkybox (false, GetComponent<Camera>());
Expand Down

0 comments on commit 0af3690

Please sign in to comment.