NewN_UAVPlane/Assets/ZFBrowser/Materials/EmulatedMipmap
YangHua a635a91f55 修改连接接口 2023-11-25 11:35:35 +08:00
..
MipSample.cginc 修改连接接口 2023-11-25 11:35:35 +08:00
MipSample.cginc.meta 修改连接接口 2023-11-25 11:35:35 +08:00
Readme.txt 修改连接接口 2023-11-25 11:35:35 +08:00
Readme.txt.meta 修改连接接口 2023-11-25 11:35:35 +08:00
Standard.shader 修改连接接口 2023-11-25 11:35:35 +08:00
Standard.shader.meta 修改连接接口 2023-11-25 11:35:35 +08:00
Transparent.shader 修改连接接口 2023-11-25 11:35:35 +08:00
Transparent.shader.meta 修改连接接口 2023-11-25 11:35:35 +08:00
Unlit.shader 修改连接接口 2023-11-25 11:35:35 +08:00
Unlit.shader.meta 修改连接接口 2023-11-25 11:35:35 +08:00
UnlitColored.shader 修改连接接口 2023-11-25 11:35:35 +08:00
UnlitColored.shader.meta 修改连接接口 2023-11-25 11:35:35 +08:00
UnlitOpaque.shader 修改连接接口 2023-11-25 11:35:35 +08:00
UnlitOpaque.shader.meta 修改连接接口 2023-11-25 11:35:35 +08:00

Readme.txt

This folder contains special shaders for rendering mimmap-free textures as if they had mipmaps.

Typically it's better to use mipmaps, but sometimes you only have the texture for one frame and it's cheaper to fake mipmaps in the shader than to generate a new mipmap every frame.

If you need a shader that's not provided here to work with emulated mipmaps you should be able to follow roughly this procedure:
	- Copy the shader in question to this folder (so it can see our .cginc)
		- You can download a copy of Unity's built-in shaders from https://unity3d.com/get-unity/download/archive
	- Change the shader name so it's in the "Emulated Mipmap" folder
	- Add `#include "./MipSample.cginc"`
	- For every "sampler2D _MyTex" you want to emulate mipmaps on, add a "float4 _MyTex_TexelSize"
		- Unity will magically fill this variable with (texel size x, texel size y, texture size x, texture size y)
	- Replace tex2D() calls with mipSample() calls.
		- For an explanation of how to use mipSample, check out the docblock in MipSample.gcinc