This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void EllipsoidTransformDerivatives(inout float2 dx, inout float2 dy) | |
{ | |
bool anyZero = length(dx) == 0 || length(dy) == 0; | |
bool parallel = (dx.x * dy.y - dx.y * dy.x) == 0; | |
bool perpendicular = dot(dx, dy) == 0; | |
bool nonFinite = isinf(dx) || isinf(dy) || isnan(dx) || isnan(dy); | |
if (!anyZero && !parallel && !perpendicular && !nonFinite) | |
{ | |
float A = dx.y*dx.y + dy.y*dy.y; | |
float B = -2.0 * (dx.x * dx.y + dy.x * dy.y); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Unlit/CompareMipSelection" | |
{ | |
Properties | |
{ | |
_MainTex ("Main color texture", 2D) = "white" {} | |
_MipTexture ("Texture with different color mips", 2D) = "white" {} | |
_AnisoLevel ("Aniso Level (must set manually to match texture)", Range(0, 16)) = 0 | |
[ToggleUI] _VisualizeMipLevels ("Visualize Mip Levels", Integer) = 0 | |
} | |
SubShader |
OlderNewer