当前位置: 首页> 财经> 创投人物 > 茂名快速建站模板_微信小程序开发的优势_微信小程序开发_百度一下就会知道了

茂名快速建站模板_微信小程序开发的优势_微信小程序开发_百度一下就会知道了

时间:2025/7/11 3:31:00来源:https://blog.csdn.net/woshiyuyanjia/article/details/143961970 浏览次数:0次
茂名快速建站模板_微信小程序开发的优势_微信小程序开发_百度一下就会知道了

1.CubeMap:有六个面的贴图组成

2. 假反射:反射天空盒子

(1)正常UV采样:

(2)Cube的采样:利用反射角采样,反射角X和Cube的交点采样

Shader "Custom/TestReflect"
{Properties{_Color ("Color", Color) = (1,1,1,1)_MainTex ("Albedo (RGB)", 2D) = "white" {}_CubeMap("Cube Map",CUBE) = "" {}_CubePower("Cube Power",float) = 0.5}SubShader{Tags { "RenderType"="Opaque" }LOD 200CGPROGRAM// Physically based Standard lighting model, and enable shadows on all  light types#pragma surface surf Lambert// Use shader model 3.0 target, to get nicer looking lighting#pragma target 3.0sampler2D _MainTex;samplerCUBE _CubeMap;struct Input{float2 uv_MainTex;float3 worldRefl;};fixed4 _Color;float _CubePower;void surf (Input IN, inout SurfaceOutput o){// Albedo comes from a texture tinted by colorfixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;o.Albedo = c.rgb;o.Emission = texCUBE(_CubeMap,IN.worldRefl).rgb*_CubePower;o.Alpha = c.a;}ENDCG}FallBack "Diffuse"
}

3.真反射:立方体上直接反映场景中的所有渲染的东西,都反射显示到cube上了,非常 消耗性能

(1)创建一个RenderTexture:

(2)主相机上的Target Texture设置为RenderTexture:

(3)需要反射的立方体的材质球上的贴图设置为RenderTexture:

关键字:茂名快速建站模板_微信小程序开发的优势_微信小程序开发_百度一下就会知道了

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: