Uninomicon

Documenting the dark corners of the Unity Engine.

User Tools

Site Tools


shadercompiler

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
shadercompiler [2021/05/02 15:35]
69.30.226.234 old revision restored (2021/04/30 05:08)
shadercompiler [2021/05/10 21:17] (current)
uninomiconadmin
Line 5: Line 5:
 Consider this code: Consider this code:
  
-<code>+<code glsl>
 #pragma shader_feature_local_fragment _ _ALBEDO; #pragma shader_feature_local_fragment _ _ALBEDO;
 TEXTURE2D(_Albedo); TEXTURE2D(_Albedo);
Line 21: Line 21:
 </code> </code>
  
-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)):+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)):
 ''"sampler_texname not found" compile error when sharing samplers'' ''"sampler_texname not found" compile error when sharing samplers''
  
Line 33: Line 33:
   * Make sure you always sample the texture associated with the sampler so it doesn't get stripped. Something like:   * Make sure you always sample the texture associated with the sampler so it doesn't get stripped. Something like:
  
-<code>+<code glsl>
 result *= saturate(1 + SAMPLE_TEXTURE2D_LOD(_Albedo, sampler_Albedo, float2(0,0), 11)); result *= saturate(1 + SAMPLE_TEXTURE2D_LOD(_Albedo, sampler_Albedo, float2(0,0), 11));
 return result; return result;
shadercompiler.1619969745.txt.gz ยท Last modified: 2021/05/02 15:35 by 69.30.226.234