Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by DizzyTornado · Dec 19, 2016 at 05:00 AM · shaderlightingeffectbloom

How to make bloom like in this photo?

How can I make bloom like on the fur and trees in this photo: https://s.aolcdn.com/hss/storage/midas/265d280011a00051c09941a36156a16b/203960328/TLG_Screen_PS4_004_1465877727-ed.jpg

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by aditya · Dec 19, 2016 at 05:16 AM

You can try this image effect

 Shader "Hidden/MobileBloom" {
     Properties {
         _MainTex ("Base (RGB)", 2D) = "white" {}
         _Bloom ("Bloom (RGB)", 2D) = "black" {}
     }
     
     CGINCLUDE
 
         #include "UnityCG.cginc"
 
         sampler2D _MainTex;
         sampler2D _Bloom;
         
         uniform fixed4 _ColorMix;    
         
         uniform half4 _MainTex_TexelSize;
         uniform fixed4 _Parameter;
         
         #define ONE_MINUS_INTENSITY _Parameter.w
 
         struct v2f_simple {
             half4 pos : SV_POSITION;
             half4 uv : TEXCOORD0;
         };
         
         struct v2f_withMaxCoords {
             half4 pos : SV_POSITION;
             half2 uv : TEXCOORD0;
             half2 uv2[4] : TEXCOORD1;
         };        
 
         struct v2f_withBlurCoords {
             half4 pos : SV_POSITION;
             half2 uv2[4] : TEXCOORD0;
         };    
         
         v2f_simple vertBloom (appdata_img v)
         {
             v2f_simple o;
             o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
             o.uv = v.texcoord.xyxy;            
             #if SHADER_API_D3D9
                 if (_MainTex_TexelSize.y < 0.0)
                     o.uv.w = 1.0 - o.uv.w;
             #endif
             return o; 
         }
 
         v2f_withMaxCoords vertMax (appdata_img v)
         {
             v2f_withMaxCoords o;
             o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
             o.uv = v.texcoord;
             o.uv2[0] = v.texcoord + _MainTex_TexelSize.xy * half2(1.5,1.5);                    
             o.uv2[1] = v.texcoord + _MainTex_TexelSize.xy * half2(-1.5,1.5);
             o.uv2[2] = v.texcoord + _MainTex_TexelSize.xy * half2(-1.5,-1.5);
             o.uv2[3] = v.texcoord + _MainTex_TexelSize.xy * half2(1.5,-1.5);
             return o; 
         }            
 
         v2f_withBlurCoords vertBlurVertical (appdata_img v)
         {
             v2f_withBlurCoords o;
             o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
             o.uv2[0] = v.texcoord + _MainTex_TexelSize.xy * half2(0.0, -1.5);            
             o.uv2[1] = v.texcoord + _MainTex_TexelSize.xy * half2(0.0, -0.5);    
             o.uv2[2] = v.texcoord + _MainTex_TexelSize.xy * half2(0.0, 0.5);    
             o.uv2[3] = v.texcoord + _MainTex_TexelSize.xy * half2(0.0, 1.5);    
             return o; 
         }    
 
         v2f_withBlurCoords vertBlurHorizontal (appdata_img v)
         {
             v2f_withBlurCoords o;
             o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
             o.uv2[0] = v.texcoord + _MainTex_TexelSize.xy * half2(-1.5, 0.0);            
             o.uv2[1] = v.texcoord + _MainTex_TexelSize.xy * half2(-0.5, 0.0);    
             o.uv2[2] = v.texcoord + _MainTex_TexelSize.xy * half2(0.5, 0.0);    
             o.uv2[3] = v.texcoord + _MainTex_TexelSize.xy * half2(1.5, 0.0);    
             return o; 
         }    
                         
         fixed4 fragBloom ( v2f_simple i ) : COLOR
         {    
             fixed4 color = tex2D(_MainTex, i.uv.xy);
             return color + tex2D(_Bloom, i.uv.zw);
         } 
         
         fixed4 fragBloomWithColorMix ( v2f_simple i ) : COLOR
         {    
             fixed4 color = tex2D(_MainTex, i.uv.xy);    
                     
             half colorDistance = Luminance(abs(color.rgb-_ColorMix.rgb));
             color = lerp(color, _ColorMix, (_Parameter.x*colorDistance));
             color += tex2D(_Bloom, i.uv.zw);            
                         
             return color;                    
         } 
         
         fixed4 fragMaxWithPain ( v2f_withMaxCoords i ) : COLOR
         {                
             fixed4 color = tex2D(_MainTex, i.uv.xy);
             color = max(color, tex2D (_MainTex, i.uv2[0]));    
             color = max(color, tex2D (_MainTex, i.uv2[1]));    
             color = max(color, tex2D (_MainTex, i.uv2[2]));    
             color = max(color, tex2D (_MainTex, i.uv2[3]));    
             return saturate(color + half4(0.25,0,0,0) - ONE_MINUS_INTENSITY);
         } 
         
         fixed4 fragMax ( v2f_withMaxCoords i ) : COLOR
         {                
             fixed4 color = tex2D(_MainTex, i.uv.xy);
             color = max(color, tex2D (_MainTex, i.uv2[0]));    
             color = max(color, tex2D (_MainTex, i.uv2[1]));    
             color = max(color, tex2D (_MainTex, i.uv2[2]));    
             color = max(color, tex2D (_MainTex, i.uv2[3]));    
             return saturate(color - ONE_MINUS_INTENSITY);
         } 
 
         fixed4 fragBlurForFlares ( v2f_withBlurCoords i ) : COLOR
         {                
             fixed4 color = tex2D (_MainTex, i.uv2[0]);
             color += tex2D (_MainTex, i.uv2[1]);
             color += tex2D (_MainTex, i.uv2[2]);
             color += tex2D (_MainTex, i.uv2[3]);
             return color * 0.25;
         }
             
     ENDCG
     
     SubShader {
       ZTest Always Cull Off ZWrite Off Blend Off
       Fog { Mode off }  
       
     // 0
     Pass {
         CGPROGRAM
         
         #pragma vertex vertBloom
         #pragma fragment fragBloom
         #pragma fragmentoption ARB_precision_hint_fastest 
         
         ENDCG
         }
     // 1
     Pass { 
         CGPROGRAM
         
         #pragma vertex vertMax
         #pragma fragment fragMax
         #pragma fragmentoption ARB_precision_hint_fastest 
         
         ENDCG     
         }    
     // 2
     Pass {
         CGPROGRAM
         
         #pragma vertex vertBlurVertical
         #pragma fragment fragBlurForFlares
         #pragma fragmentoption ARB_precision_hint_fastest 
         
         ENDCG 
         }    
     // 3            
     Pass {
         CGPROGRAM
         
         #pragma vertex vertBlurHorizontal
         #pragma fragment fragBlurForFlares
         #pragma fragmentoption ARB_precision_hint_fastest 
         
         ENDCG
         }
     // 4            
     Pass {
         CGPROGRAM
         
         #pragma vertex vertBloom
         #pragma fragment fragBloomWithColorMix
         #pragma fragmentoption ARB_precision_hint_fastest 
         
         ENDCG
         }
     // 5            
     Pass {
         CGPROGRAM
         
         #pragma vertex vertMax
         #pragma fragment fragMaxWithPain
         #pragma fragmentoption ARB_precision_hint_fastest 
         
         ENDCG
         }
     }
     FallBack Off
 }
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

94 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Creating this light effect 1 Answer

Unity 5 2D Bloom Effect? 2 Answers

Neon light or LED light 1 Answer

Glow Effect 3 Answers

Light glow effect test 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges