- Home /
Question by
avoorhees · Sep 21, 2012 at 07:39 PM ·
shadermaterialreflectionsmipmap
Control mips in shader
Hey All, I'm trying to find a way to control the mip levels of a texture in my shader. I want to be able to blur a cubemap reflection to get a more glossy/softer reflection.
Thanks!
Shader "WMS/Chrome" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_SpecColor ("Specular Color", Color) = (1, 1, 1, 1)
_RefColor ("Reflection Color", Color) = (1, 1, 1, 1)
_Shininess ("Shininess", Range (0.03, 1)) = 0.078125
_BumpMap ("Normal", 2D) = "bump" {}
_Cube ("Cubemap", CUBE) = "" {}
}
SubShader {
Tags { "RenderType" = "Opaque" }
CGPROGRAM
#pragma surface surf BlinnPhong
#pragma target 3.0
struct Input {
float2 uv_BumpMap;
float3 worldRefl;
INTERNAL_DATA
};
samplerCUBE _Cube;
sampler2D _BumpMap;
fixed4 _Color;
fixed4 _RefColor;
half _Shininess;
void surf (Input IN, inout SurfaceOutput o) {
o.Albedo = _Color.rgb;
o.Gloss = _SpecColor.rgb;
o.Specular = _Shininess;
o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
o.Emission = texCUBE (_Cube, WorldReflectionVector (IN, o.Normal)) * _RefColor;
}
ENDCG
}
Fallback "Specular"
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613081324im_/https://answers.unity.com/themes/thub/images/avi.jpg)