- 1、本文档共12页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
水shader效果
Shader FX/Water {??Properties {??_WaveScale (Wave scale, Range (0.02,0.15)) = 0.063??_ReflDistort (Reflection distort, Range (0,1.5)) = 0.44??_RefrDistort (Refraction distort, Range (0,1.5)) = 0.40??_RefrColor (Refraction color, COLOR) = ( .34, .85, .92, 1)??_Fresnel (Fresnel (A) , 2D) = gray {}??_BumpMap (Bumpmap (RGB) , 2D) = bump {}??WaveSpeed (Wave speed (map1 x,y; map2 x,y), Vector) = (19,9,-16,-7)??_ReflectiveColor (Reflective color (RGB) fresnel (A) , 2D) = {}??_ReflectiveColorCube (Reflective color cube (RGB) fresnel (A), Cube) = { TexGen CubeReflect }??_HorizonColor (Simple water horizon color, COLOR) = ( .172, .463, .435, 1)??_MainTex (Fallback texture, 2D) = {}??_ReflectionTex (Internal Reflection, 2D) = {}??_RefractionTex (Internal Refraction, 2D) = {}??}??// -----------------------------------------------------------??// Fragment program cards??Subshader {??Tags { WaterMode=Refractive RenderType=Opaque }??Pass {??CGPROGRAM??#pragma vertex vert??#pragma fragment frag??#pragma fragmentoption ARB_precision_hint_fastest??#pragma fragmentoption ARB_fog_exp2??#pragma multi_compile WATER_REFRACTIVE WATER_REFLECTIVE WATER_SIMPLE??#if defined WATER_REFLECTIVE || defined WATER_REFRACTIVE??#define HAS_REFLECTION 1??#endif??#if defined WATER_REFRACTIVE??#define HAS_REFRACTION 1??#endif??#include UnityCG.cginc??uniform float4 _WaveScale4;??uniform float4 _WaveOffset;??#ifdef HAS_REFLECTION??uniform float _ReflDistort;??#endif??#ifdef HAS_REFRACTION??uniform float _RefrDistort;??#endif??struct appdata {??float4 vertex : POSITION;??float3 normal : NORMAL;??};??struct v2f {??V2F_POS_FOG;??#if defined HAS_REFLECTION || defined HAS_REFRACTION??float3 ref;??#endif??float2 bumpuv[2];??float3 viewDir;??};??v2f vert(appdata v)??{??v2f o;??PositionFog( v.vertex, o.pos, o.fog );??// scroll bump waves??float4 temp;??temp.xyzw = v.vertex.xzxz * _WaveScale4 + _WaveOffset;??o.bumpuv[0] = temp.xy;??o.bumpuv[1] = temp.wz;??// object space view direction (will normalize per pixe
文档评论(0)