shadercompiler
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
shadercompiler [2021/04/30 04:44] – uninomiconadmin | shadercompiler [2025/01/15 04:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 5: | Line 5: | ||
Consider this code: | Consider this code: | ||
- | < | + | < |
#pragma shader_feature_local_fragment _ _ALBEDO; | #pragma shader_feature_local_fragment _ _ALBEDO; | ||
TEXTURE2D(_Albedo); | TEXTURE2D(_Albedo); | ||
Line 21: | Line 21: | ||
</ | </ | ||
- | + | When compiling, two variants are created, one for when albedo is on, another for when it's off. This will throw an error saying that sampler_albedo cannot be found((Note: | |
- | When compiling, two variants are created, one for when albedo is on, another for when it's off. This will throw an error saying that sampler_albedo cannot be found ((Note: this error will only be thrown on some platforms (windows)) ((the spelling of the error is wrong, as it's all lowercase when the variable is not)) | + | ''" |
DX9 associates samplers with textures, and so Unity does too. When you set a Unity Texture to '' | DX9 associates samplers with textures, and so Unity does too. When you set a Unity Texture to '' | ||
Line 33: | Line 33: | ||
* Make sure you always sample the texture associated with the sampler so it doesn' | * Make sure you always sample the texture associated with the sampler so it doesn' | ||
- | < | + | < |
result *= saturate(1 + SAMPLE_TEXTURE2D_LOD(_Albedo, | result *= saturate(1 + SAMPLE_TEXTURE2D_LOD(_Albedo, | ||
return result; | return result; |
shadercompiler.1619757845.txt.gz · Last modified: 2025/01/15 04:35 (external edit)