Noticias

¡RECUERDA QUE SI ERES UN NUEVO USUARIO, DEBES PRESENTARTE PARA PODER PUBLICAR MENSAJES! | TENEMOS CANAL OFICIAL DE TELEGRAM: t.me/unity3dspain

Espuma en la orilla del océano para v5.5.2

Iniciado por Miguel_Angel, Marzo 10, 2017, 07:29:32 AM

Tema anterior - Siguiente tema
Marzo 10, 2017, 07:29:32 AM Ultima modificación: Marzo 10, 2017, 06:54:45 PM por Miguel_Angel
No se si ya alguien ha solucionado esto, pero cuando he pasado mi juego a la versión 5.5.2 de Unity me he encontrado que la espuma del océano en el borde de la costa no salia, después de trastear un buen rato descubrí como solucionarlo.
 

            //S***LINES
         #ifdef S***_ON
         //UNITY5.5
         #if defined(UNITY_REVERSED_Z)
            float zdepth = 1.0f - LinearE***epth (tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(i.ref)).r);
         #else
            float zdepth = LinearE***epth (tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(i.ref)).r);
         #endif
         float intensityFactor = 1- saturate((zdepth- i.ref.z) / _S***Distance);  
         half3 foamGradient = _S***Strength - tex2D(_FoamGradient, float2(intensityFactor - i.bumpTexCoord.w, 0) + tangentNormal.xy);
         foam += foamGradient * intensityFactor * _foam;
         #endif

 
Por
 

            //Esto funciona en la version 5.3.6 con  i.ref.z con i.ref.w version 5.5.2
         #ifdef S***_ON
            float zdepth = LinearE***epth(tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(i.ref)).r);
            float intensityFactor = 1 - saturate((zdepth - i.ref.w) / _S***Distance);
            half3 foamGradient = _S***Strength - tex2D(_FoamGradient, float2(intensityFactor - i.bumpTexCoord.w, 0) + tangentNormal.xy);
            foam += foamGradient * intensityFactor * _foam;
         #endif

 
OceanL1.shader
 
Cambiar
 

               //S***LINES
            #ifdef S***_ON
            //UNITY5.5
            #if defined(UNITY_REVERSED_Z)
               float zdepth = 1.0f - LinearE***epth (tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(i.ref)).r);
            #else
               float zdepth = LinearE***epth (tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(i.ref)).r);
            #endif
            float intensityFactor = 1 - saturate((zdepth - i.ref.z) / _S***Distance);  
            foam += _S***Strength * intensityFactor * _foam  ;
            #endif

 
Por
 

               //S***LINES
            #ifdef S***_ON
               //UNITY5.5.2
               float zdepth = LinearE***epth (tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(i.ref)).r);
               float intensityFactor = 1 - saturate((zdepth - i.ref.w) / _S***Distance);  
               foam += _S***Strength * intensityFactor * _foam  ;
            #endif

 
Aunque ya he visto que esta dirección ya esta en el foro, la vuelvo a poner. El Ocean_Community_Next_Gen original se descarga aquí https://github.com/eliasts/Ocean_Community_Next_Gen

Gran aporte tio, Gracias!

····>Desarrollando un videojuegos online-arcade para Android.


····>Programador en:C,C#,VB.net,PHP,HTML5,SQL,JS,Ruby.


····>Trabajando en: Desarrollo de paginas web y bushistudios.


                    ๑۩۞۩๑_(▀▄)KINGTRASE(▄▀)_๑۩۞۩๑ 



De nada, espero que le sea útil a alguien, Había pensado en usar Water4 para evitar el problema, pero Ocean tiene mejor rendimiento y a pesar que todavía tiene un par de problemas me gusta mas.

Etiquetas: