wartheking 6c06324f6c first last commit 11 tháng trước cách đây
..
MipSample.cginc 6c06324f6c first last commit 11 tháng trước cách đây
MipSample.cginc.meta 6c06324f6c first last commit 11 tháng trước cách đây
Readme.txt 6c06324f6c first last commit 11 tháng trước cách đây
Readme.txt.meta 6c06324f6c first last commit 11 tháng trước cách đây
Standard.shader 6c06324f6c first last commit 11 tháng trước cách đây
Standard.shader.meta 6c06324f6c first last commit 11 tháng trước cách đây
Transparent.shader 6c06324f6c first last commit 11 tháng trước cách đây
Transparent.shader.meta 6c06324f6c first last commit 11 tháng trước cách đây
Unlit.shader 6c06324f6c first last commit 11 tháng trước cách đây
Unlit.shader.meta 6c06324f6c first last commit 11 tháng trước cách đây
UnlitColored.shader 6c06324f6c first last commit 11 tháng trước cách đây
UnlitColored.shader.meta 6c06324f6c first last commit 11 tháng trước cách đây
UnlitOpaque.shader 6c06324f6c first last commit 11 tháng trước cách đây
UnlitOpaque.shader.meta 6c06324f6c first last commit 11 tháng trước cách đây

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