Search Unity

IndieEffects: Bringing (almost) AAA quality Post-Process FX to Unity Indie

Discussion in 'Assets and Asset Store' started by FuzzyQuills, Sep 2, 2013.

  1. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    430
    Eric the shaders don't have to be optimized, since I have pro and I have the profiler it is the cpu side that is performance heavy since shaders are done on GPU and the Scripts on CPU (Correct me if I'm wrong), the scripts are the ones that need serious optimization, I already have a list (Sort of) of what fuzzy or us that we need to include to the scripts to optimize.
    1. Downsampling, this should be an Int variable and this effect degrades the RT resolution for performance.
    2. Have a frame delay so ReadPixels or Resize doesn't occur every single frame,
    3. Don't set values every single frame, set it once
    BTW nice logo.
     
  2. Cyrien5100

    Cyrien5100

    Joined:
    Oct 17, 2012
    Posts:
    145
    I think you should set values every frames, as the SetFloat function is not expensive (it's like a transform.position = ...), and it allows user to modify it in runtime (for example increase DoF in cinematic and decrease it smoothly, autofocus, make the screen more blurier or not when hurted).
    However, downsampling and frame delay are useful.
     
  3. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    I've also noticed that so I've begun that process in the new effects.
     
  4. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Thanks!
    Wait do you have the pro trial???
    Also does anyone have an example of downsampling?
     
    Last edited: Jul 6, 2014
  5. yapaysinek

    yapaysinek

    Joined:
    Nov 19, 2013
    Posts:
    5
    @FuzzyQuills Are we allowed to use this in our project?? And do you have copyright or something on it?? Btw this is AWESOME!!! You've done a great job!! :D
     
  6. WGermany

    WGermany

    Joined:
    Jun 27, 2013
    Posts:
    78
    Some of the effects are ported from shaders that I've ported. Or have taught how to others or made up. I could essentially do many different effects with Unity Indie but my focus has been on revolutionizing the unity renderer for now. (Unity Pro) If you want to know the legal stuff, check the references I posted along with the shaders I posted in many places on the web, such as on ArmedUnity.
     
  7. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Most do not have copyright restrictions. But you are not allowed to sell it as it is.
     
  8. yapaysinek

    yapaysinek

    Joined:
    Nov 19, 2013
    Posts:
    5
    @WGermany Can you send me the link because i couldnt really find it :/// Thanks in advice :))
     
  9. yapaysinek

    yapaysinek

    Joined:
    Nov 19, 2013
    Posts:
    5
    @Eric2241 I was just wondering if its free for commercial use or not. Btw thanks everyone for the replies :))
     
  10. Gogin

    Gogin

    Joined:
    Nov 9, 2013
    Posts:
    60
    Can I ask when will be released date? Circa.. btw, can anyone make a volumetric fog similar to mirandas's fog?
     
  11. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    We would need a shader; so if you could find one we could port it. Though miranda's shader is very performance costly; looking at his screenshots, its always a very small amount. I'm trying to port the global fog though it never displays the actual fog...I've done the correct process, but right now I'm trying to get sweetfx's hdr to work.
     
  12. KennethVedder

    KennethVedder

    Joined:
    Aug 29, 2012
    Posts:
    7
    WOW!! Well Fuzzy Quills, that's so awesome, i'm gonna help some people in my facebook unity page by sharing this, this is awesome
     
  13. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,869
    Hi guys! looking good! :)

    Sorry for the delay! the new version hasn't been out yet, as I have been a bit lazy, being it's the school holidays... ;)

    But not to worry! I am getting my coding and patience back up, and I am also taking a shot at building a linux OS myself, so while it is building stuff, I may also secretly (not really...) release the new one! All I ask is that all contributions be posted one after the other, wherever possible! :) also feel free to PM me the packages if you like.

    meanwhile... although I have implemented everything frosty stated up top before, there is a problem with the downscaling ATM. because I couldn't do it with a single camera, using a second camera for capturing the screen at POT size has doubled the drawcalls! I am currently working on trying to use only one camera for the POT image, EVEN if it means disabling the main camera to do it!
     
  14. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,869
    For all to hear as well: basically, don't try and use my source code as if it was your own, and it will be fine. You are free to use it for anything else, especially for commercial use: what's the use of a free indie fx pack when you can't use it in a commercial game?! :D

    BTW, Eric, thanks for making that logo! it's epic! may integrate it later!
     
  15. XrOs_FiRE

    XrOs_FiRE

    Joined:
    Jul 8, 2014
    Posts:
    4
    Sooo.. this means we can use the effects for commercial use as well?? @FuzzyQuills
     
  16. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Yes pretty much but some shaders MAY have copyright restrictions...
     
  17. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Thanks man!!!!
     
  18. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Wait! So I can post more effects?!
     
  19. XrOs_FiRE

    XrOs_FiRE

    Joined:
    Jul 8, 2014
    Posts:
    4
    Last edited: Jul 8, 2014
  20. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    I don't think so.
     
  21. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    430
    yes you can however since you port a lot of willywills effects he may have some copy right restrictions to some of the shaders. and you'll have to ask him for permission to port those shaders he made.
     
  22. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Here are some more of the Unity image effects, I have one more but I'll just have to find it in my files.

    Attached are the Sepia Tone effect and the Noise effect.
     

    Attached Files:

  23. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Here is the updated hdr shader; it keeps telling me that it "Temporary register limit of 16 exceeded; 17 registers needed to compile program" .
    The Shader
    Code (csharp):
    1.  
    2. Shader "Custom/HDR" {
    3.    
    4.     Properties
    5.     {
    6.         _MainTex ("Base (RGB)", 2D) = "white" {}
    7.         _radius1 ("Radius 1", Range(-2000, 2000)) = 1
    8.         _radius2 ("Radius 2", Range(-2000, 2000)) = 1
    9.         _HDRPower ("HDR Power", Range(-2000, 2000)) = 1
    10.     }
    11.  
    12.     SubShader
    13.     {
    14.         Pass{
    15.         CGPROGRAM
    16.         #pragma vertex vert_img
    17.         #pragma fragment frag
    18.         #include "UnityCG.cginc"
    19.         uniform sampler2D _MainTex;
    20.         uniform float radius1;
    21.         uniform float radius2;
    22.         uniform float HDRPower;
    23.         uniform float4 colorInput;
    24.         uniform float2 Tex;
    25.         float4 frag(v2f_img i) : COLOR
    26.         {
    27.                
    28.                 float3 c_center = tex2D(_MainTex, i.uv).rgb;
    29.                  //reuse SMAA center sample or lumasharpen center sample?
    30.     //float3 c_center = colorInput.rgb; //or just the input?
    31.    
    32.     //float3 bloom_sum1 = float3(0.0, 0.0, 0.0); //don't initialize to 0 - use the first tex2D to do that
    33.     //float3 bloom_sum2 = float3(0.0, 0.0, 0.0); //don't initialize to 0 - use the first tex2D to do that
    34.     //Tex += float2(0, 0); // +0 ? .. oh riiiight - that will surely do something useful
    35.    
    36.     float radius1 = 0.793;
    37.     float3 bloom_sum1 = tex2D(_MainTex, Tex + float2(1.5, -1.5) * radius1).rgb;
    38.     bloom_sum1 += tex2D(_MainTex, Tex + float2(-1.5, -1.5) * radius1).rgb; //rearrange sample order to minimize ALU and maximize cache usage
    39.     bloom_sum1 += tex2D(_MainTex, Tex + float2(1.5, 1.5) * radius1).rgb;
    40.     bloom_sum1 += tex2D(_MainTex, Tex + float2(-1.5, 1.5) * radius1).rgb;
    41.    
    42.     bloom_sum1 += tex2D(_MainTex, Tex + float2(0, -2.5) * radius1).rgb;
    43.     bloom_sum1 += tex2D(_MainTex, Tex + float2(0, 2.5) * radius1).rgb;
    44.     bloom_sum1 += tex2D(_MainTex, Tex + float2(-2.5, 0) * radius1).rgb;
    45.     bloom_sum1 += tex2D(_MainTex, Tex + float2(2.5, 0) * radius1).rgb;
    46.    
    47.     bloom_sum1 *= 0.005;
    48.    
    49.     float3 bloom_sum2 = tex2D(_MainTex, Tex + float2(1.5, -1.5) * radius2).rgb;
    50.     bloom_sum2 += tex2D(_MainTex, Tex + float2(-1.5, -1.5) * radius2).rgb;
    51.     bloom_sum2 += tex2D(_MainTex, Tex + float2(1.5, 1.5) * radius2).rgb;
    52.     bloom_sum2 += tex2D(_MainTex, Tex + float2(-1.5, 1.5) * radius2).rgb;
    53.  
    54.  
    55.     bloom_sum2 += tex2D(_MainTex, Tex + float2(0, -2.5) * radius2).rgb;
    56.     bloom_sum2 += tex2D(_MainTex, Tex + float2(0, 2.5) * radius2).rgb;
    57.     bloom_sum2 += tex2D(_MainTex, Tex + float2(-2.5, 0) * radius2).rgb;
    58.     bloom_sum2 += tex2D(_MainTex, Tex + float2(2.5, 0) * radius2).rgb;
    59.  
    60.     bloom_sum2 *= 0.010;
    61.    
    62.     float dist = radius2 - radius1;
    63.    
    64.     float3 HDR = (c_center + (bloom_sum2 - bloom_sum1)) * dist;
    65.     float3 blend = HDR + colorInput.rgb;
    66.     colorInput.rgb = HDR + pow(blend, HDRPower); // pow - don't use fractions for HDRpower
    67.    
    68.     return saturate(colorInput);
    69.         }
    70.         ENDCG
    71.         }
    72.     }
    73.     FallBack "Diffuse"
    74. }
    75.  
    The C# code
    Code (csharp):
    1.  
    2. using System.Collections;
    3. [ExecuteInEditMode]
    4. public class HDR : MonoBehaviour {
    5.     private Material Mat;
    6.     public Shader matShader;
    7.     public float radius1;
    8.     public float radius2;
    9.     public float HDRPower;
    10.     // Use this for initialization
    11.     void Start () {
    12.         Mat = new Material(matShader);
    13.     }
    14.    
    15.     // Update is called once per frame
    16.     void Update () {
    17.         Mat.SetFloat("_HDRPower", HDRPower);
    18.         Mat.SetFloat("_radius1", radius1);
    19.         Mat.SetFloat("_radius2", radius2);
    20.         Mat.SetTexture("_MainTex", IndieEffects.renderTexture);
    21.  
    22.     }
    23.     void OnPostRender(){
    24.         IndieEffects.FullScreenQuad(Mat);
    25.     }
    26. }
    27.  
     
  24. XrOs_FiRE

    XrOs_FiRE

    Joined:
    Jul 8, 2014
    Posts:
    4
    Who should i ask for permission to use the motion blur because i need it so bad for my project and i couldnt find it anywhere else.. Btw thanks everyone for the answeres. :DD @Frostbite23 @Eric2241 @FuzzyQuills
     
  25. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    I believe its fine. Can I see a link to your project?
     
  26. XrOs_FiRE

    XrOs_FiRE

    Joined:
    Jul 8, 2014
    Posts:
    4
    Sure.. I will send a link to you in the conversations as soon as im done with the demo where im gonna use it.. :) @Eric2241
     
  27. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    430
    @Eric2241 add this
    Code (JavaScript):
    1. #pragma target 3.0
    this will target shader models 3.0 and higher and this allows more registers to be used however lower shader models have lower registers (i think I'm using the wrong name).
     
  28. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Cool thanks, I'll try it out tomorrow!
     
  29. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,869
    Thanks everyone! Frosty, I want you to pack your current fx into one big pack, then send a link to me. (A Dropbox link, perhaps? :D)

    Eric, you have already done this by the look of it, so thanks for your cooperation! and I realised why my blurring for the bloom effect was so expensive: I was blurring the image per texel, instead of the whole image, which didn't look terribly good either...

    and also watch for copyright restrictions, if you need to, ask for permission before porting! I don't want to get mixed up in legal problems... o_O

    @XrOs_FiRE: Yes, the motion blur has no restrictions whatsoever, I even encourage you to improve it if you like! (and have the knowledge!) And what's this project you speak of? I am considering an image gallery for IndieEffects as this thread only really has images of my *terrible* test scene.
     
  30. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    WTF!!!! it just inverts the color!!!
    The Shader
    Code (csharp):
    1.  
    2. Shader "Custom/HDR" {
    3.    
    4.     Properties
    5.     {
    6.         _MainTex ("Base (RGB)", 2D) = "white" {}
    7.         _radius1 ("Radius 1", Range(-2000, 2000)) = 1
    8.         _radius2 ("Radius 2", Range(-2000, 2000)) = 1
    9.         _HDRPower ("HDR Power", Range(-2000, 2000)) = 1
    10.     }
    11.  
    12.     SubShader
    13.     {
    14.         Pass{
    15.         CGPROGRAM
    16.         #pragma target 3.0
    17.         #pragma vertex vert_img
    18.         #pragma fragment frag
    19.         #include "UnityCG.cginc"
    20.         uniform sampler2D _MainTex;
    21.         uniform float radius1;
    22.         uniform float radius2;
    23.         uniform float HDRPower;
    24.         uniform float4 colorInput;
    25.         uniform float2 Tex;
    26.        
    27.         float4 frag(v2f_img i) : COLOR
    28.         {
    29.                
    30.                 float3 c_center = tex2D(_MainTex, i.uv).rgb;
    31.                  //reuse SMAA center sample or lumasharpen center sample?
    32.     //float3 c_center = colorInput.rgb; //or just the input?
    33.    
    34.     //float3 bloom_sum1 = float3(0.0, 0.0, 0.0); //don't initialize to 0 - use the first tex2D to do that
    35.     //float3 bloom_sum2 = float3(0.0, 0.0, 0.0); //don't initialize to 0 - use the first tex2D to do that
    36.     //Tex += float2(0, 0); // +0 ? .. oh riiiight - that will surely do something useful
    37.    
    38.     float radius1 = 0.793;
    39.     float3 bloom_sum1 = tex2D(_MainTex, Tex + float2(1.5, -1.5) * radius1).rgb;
    40.     bloom_sum1 += tex2D(_MainTex, Tex + float2(-1.5, -1.5) * radius1).rgb; //rearrange sample order to minimize ALU and maximize cache usage
    41.     bloom_sum1 += tex2D(_MainTex, Tex + float2(1.5, 1.5) * radius1).rgb;
    42.     bloom_sum1 += tex2D(_MainTex, Tex + float2(-1.5, 1.5) * radius1).rgb;
    43.    
    44.     bloom_sum1 += tex2D(_MainTex, Tex + float2(0, -2.5) * radius1).rgb;
    45.     bloom_sum1 += tex2D(_MainTex, Tex + float2(0, 2.5) * radius1).rgb;
    46.     bloom_sum1 += tex2D(_MainTex, Tex + float2(-2.5, 0) * radius1).rgb;
    47.     bloom_sum1 += tex2D(_MainTex, Tex + float2(2.5, 0) * radius1).rgb;
    48.    
    49.     bloom_sum1 *= 0.005;
    50.    
    51.     float3 bloom_sum2 = tex2D(_MainTex, Tex + float2(1.5, -1.5) * radius2).rgb;
    52.     bloom_sum2 += tex2D(_MainTex, Tex + float2(-1.5, -1.5) * radius2).rgb;
    53.     bloom_sum2 += tex2D(_MainTex, Tex + float2(1.5, 1.5) * radius2).rgb;
    54.     bloom_sum2 += tex2D(_MainTex, Tex + float2(-1.5, 1.5) * radius2).rgb;
    55.  
    56.  
    57.     bloom_sum2 += tex2D(_MainTex, Tex + float2(0, -2.5) * radius2).rgb;
    58.     bloom_sum2 += tex2D(_MainTex, Tex + float2(0, 2.5) * radius2).rgb;
    59.     bloom_sum2 += tex2D(_MainTex, Tex + float2(-2.5, 0) * radius2).rgb;
    60.     bloom_sum2 += tex2D(_MainTex, Tex + float2(2.5, 0) * radius2).rgb;
    61.  
    62.     bloom_sum2 *= 0.010;
    63.    
    64.     float dist = radius2 - radius1;
    65.    
    66.     float3 HDR = (c_center + (bloom_sum2 - bloom_sum1)) * dist;
    67.     float3 blend = HDR + colorInput.rgb;
    68.     colorInput.rgb = HDR + pow(blend, HDRPower); // pow - don't use fractions for HDRpower
    69.    
    70.     return saturate(colorInput);
    71.  
    72.    
    73.    
    74.         }
    75.         ENDCG
    76.         }
    77.     }
    78.     FallBack "Diffuse"
    79. }
    80.  
    C# code - should not have anything wrong with it.

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. [ExecuteInEditMode]
    5. public class HDR : MonoBehaviour {
    6.     private Material Mat;
    7.     public Shader matShader;
    8.     public float radius1;
    9.     public float radius2;
    10.     public float HDRPower;
    11.     // Use this for initialization
    12.     void Start () {
    13.         Mat = new Material(matShader);
    14.     }
    15.    
    16.     // Update is called once per frame
    17.     void Update () {
    18.         Mat.SetFloat("_HDRPower", HDRPower);
    19.         Mat.SetFloat("_radius1", radius1);
    20.         Mat.SetFloat("_radius2", radius2);
    21.         Mat.SetTexture("_MainTex", IndieEffects.renderTexture);
    22.  
    23.     }
    24.     void OnPostRender(){
    25.         IndieEffects.FullScreenQuad(Mat);
    26.     }
    27. }
    28.  
     
  31. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    I'll compile all my fX into one big pack tomorrow. As at the moment the are just kinda loose files but if you have the time or want to just download all the effects and make an archive of them.
     
  32. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,869
    Erm... your screenshot is saying "NullReferenceException," could that be the problem?

    And yes, where possible, grab all the files and pop them into one pack.

    and your dist variable could be the problem. try adding instead of subtracting.
     
  33. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    I don't think so, because it's most likely pointing to something I forgot to assign in another script, though changing the values does nothing at all. I'll try your suggestion. This should be the shaders and scripts.
     

    Attached Files:

  34. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    430
    @Eric2241 the pragma 3.0 doesn't change anything in the shader, it just only allow shader models 3.0 and higher so more registers can be used.
     
  35. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    I realized that after taking a look I'm the documentation, though the shader is from sweetfx and its hlsl so the "meat" portions should work. It does I took a look at this http://delightlylinux.wordpress.com/2014/02/04/sweetfx-hdr/ though that means that the values aren't working.
     
    Last edited: Jul 10, 2014
  36. AlphaGarg8447

    AlphaGarg8447

    Joined:
    Jul 28, 2013
    Posts:
    19
    The links are down, can you reupload it?I'm not being able to download it.

    PS: I highly recommend Mediafire. Thanks!
     
  37. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Which one?
     
  38. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Here is the current HDR effect; problems include the values not doing anything though the C# script should be correct.

    C#

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. [ExecuteInEditMode]
    5. public class HDR : MonoBehaviour {
    6.     private Material Mat;
    7.     public Shader matShader;
    8.     public float radius2 = 0.25f;
    9.     public float HDRPower = 0.25f;
    10.     // Use this for initialization
    11.     void Start () {
    12.         Mat = new Material(matShader);
    13.     }
    14.    
    15.     // Update is called once per frame
    16.     void Update () {
    17.         Mat.SetFloat("_radius2", radius2);
    18.         Mat.SetFloat("_HDRPower", HDRPower);
    19.         Mat.SetTexture("_MainTex", IndieEffects.renderTexture);
    20.  
    21.     }
    22.     void OnPostRender(){
    23.         IndieEffects.FullScreenQuad(Mat);
    24.     }
    25. }
    26.  
    Shader

    Code (csharp):
    1.  
    2. Shader "Custom/HDR" {
    3.    
    4.     Properties
    5.     {
    6.         _MainTex ("Base (RGB)", 2D) = "white" {}
    7.         _radius2 ("radius2", float) = 1
    8.         _HDRPower ("HDRPower", float) = 1
    9.     }
    10.  
    11.     SubShader
    12.     {
    13.         Pass{
    14.         CGPROGRAM
    15.         #pragma target 3.0
    16.         #pragma vertex vert_img
    17.         #pragma fragment frag
    18.         #include "UnityCG.cginc"
    19.         uniform sampler2D _MainTex;
    20.         uniform float radius1;
    21.         uniform float radius2;
    22.         uniform float HDRPower;
    23.         uniform float4 colorInput;
    24.         uniform float2 Tex;
    25.        
    26.         float4 frag(v2f_img i) : COLOR
    27.         {
    28.                
    29.                 float3 c_center = tex2D(_MainTex, i.uv).rgb;
    30.                  //reuse SMAA center sample or lumasharpen center sample?
    31.     //float3 c_center = colorInput.rgb; //or just the input?
    32.    
    33.     //float3 bloom_sum1 = float3(0.0, 0.0, 0.0); //don't initialize to 0 - use the first tex2D to do that
    34.     //float3 bloom_sum2 = float3(0.0, 0.0, 0.0); //don't initialize to 0 - use the first tex2D to do that
    35.     //Tex += float2(0, 0); // +0 ? .. oh riiiight - that will surely do something useful
    36.     radius2 = 0.75;
    37.     HDRPower = 10;
    38.     float radius1 = 0.793;
    39.     float3 bloom_sum1 = tex2D(_MainTex, Tex + float2(1.5, -1.5) * radius1).rgb;
    40.     bloom_sum1 += tex2D(_MainTex, Tex + float2(-1.5, -1.5) * radius1).rgb; //rearrange sample order to minimize ALU and maximize cache usage
    41.     bloom_sum1 += tex2D(_MainTex, Tex + float2(1.5, 1.5) * radius1).rgb;
    42.     bloom_sum1 += tex2D(_MainTex, Tex + float2(-1.5, 1.5) * radius1).rgb;
    43.    
    44.     bloom_sum1 += tex2D(_MainTex, Tex + float2(0, -2.5) * radius1).rgb;
    45.     bloom_sum1 += tex2D(_MainTex, Tex + float2(0, 2.5) * radius1).rgb;
    46.     bloom_sum1 += tex2D(_MainTex, Tex + float2(-2.5, 0) * radius1).rgb;
    47.     bloom_sum1 += tex2D(_MainTex, Tex + float2(2.5, 0) * radius1).rgb;
    48.    
    49.     bloom_sum1 *= 0.005;
    50.    
    51.     float3 bloom_sum2 = tex2D(_MainTex, Tex + float2(1.5, -1.5) * radius2).rgb;
    52.     bloom_sum2 += tex2D(_MainTex, Tex + float2(-1.5, -1.5) * radius2).rgb;
    53.     bloom_sum2 += tex2D(_MainTex, Tex + float2(1.5, 1.5) * radius2).rgb;
    54.     bloom_sum2 += tex2D(_MainTex, Tex + float2(-1.5, 1.5) * radius2).rgb;
    55.  
    56.  
    57.     bloom_sum2 += tex2D(_MainTex, Tex + float2(0, -2.5) * radius2).rgb;
    58.     bloom_sum2 += tex2D(_MainTex, Tex + float2(0, 2.5) * radius2).rgb;
    59.     bloom_sum2 += tex2D(_MainTex, Tex + float2(-2.5, 0) * radius2).rgb;
    60.     bloom_sum2 += tex2D(_MainTex, Tex + float2(2.5, 0) * radius2).rgb;
    61.  
    62.     bloom_sum2 *= 0.010;
    63.    
    64.     float dist = radius2 - radius1;
    65.    
    66.     float3 HDR = (c_center + (bloom_sum2 - bloom_sum1)) * dist;
    67.     float3 blend = HDR + colorInput.rgb;
    68.     colorInput.rgb = HDR + pow(blend, HDRPower); // pow - don't use fractions for HDRpower
    69.    
    70.     return saturate(colorInput);
    71.  
    72.    
    73.    
    74.         }
    75.         ENDCG
    76.         }
    77.     }
    78.     FallBack "Diffuse"
    79. }
    80.  
     
  39. AlphaGarg8447

    AlphaGarg8447

    Joined:
    Jul 28, 2013
    Posts:
    19
    No nevermind, it was Google Docs extension that wasn't letting me download (don't know why)
    Sorry for any trouble.
     
  40. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    It's fine, happy developing!
     
  41. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    430
    That doesn't look like HDR to me, it just looks like some bloom with values customizing the image.
     
  42. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    It's not true hdr but it's better than nothing. Could someone help me fix the script; right now the values won't change.
     
  43. thetoxicuser

    thetoxicuser

    Joined:
    Jan 11, 2013
    Posts:
    34


    whenever I even touch the shader, it crashes unity. Also it makes the screen go black whenever applied. Is the script and shader complete or is it not finished?
     
  44. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    The hdr power amount is too high make the radius2 value 0.5 less than the hdrpower amount.

    HDR like effect

    Here is the effect, I'm still getting it to work more properly.

    Hats off to Willywill for helping me to get this to work.

    Screenshot:


    Values:

    Radius 2: 1.3

    Radius 1: 0.793

    HDRPower: 0.68
     

    Attached Files:

    Last edited: Jul 14, 2014
  45. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,869
    Maybe a web demo could win us over? i don't see anything either...

    A youtube or vimeo clip would be nice too, if uploading a player is too much for your internet. BTW, if you need some help, I can ask Cyrien for pointers, as he got a form of HDR working with his pack.
     
  46. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    This is the sweetfx shader ported to unity so it's not ture hdr, but if you could ask cryien for some help for a true hdr shader that would be nice! However as for the player unity won't compile and build anything from my current project...

    Google drive link (more graphic intensive)

    https://1332c71ada526249b9758f89461...rm9lGoTbnRsODlKODd5REU/HDR Demo_ Plateau.html

    Less graphic intensive demo

    https://bcc2520b687d0e903501a1e7644...st/0B_BvMrm9lGoTNzlJaFRhMlhNX3M/HDR Demo.html
     
    Last edited: Jul 12, 2014
  47. thetoxicuser

    thetoxicuser

    Joined:
    Jan 11, 2013
    Posts:
    34

    yahh I can't export any projects either. does it just show the normal stuff while exporting then the file doesn't appear?
     
  48. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    I finally got it to work...somehow
     
  49. thetoxicuser

    thetoxicuser

    Joined:
    Jan 11, 2013
    Posts:
    34
    any clue on how?
     
  50. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Other than making my CPU 55ºC, no.
     
unityunity