20 lines
		
	
	
		
			366 B
		
	
	
	
		
			Plaintext
		
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			366 B
		
	
	
	
		
			Plaintext
		
	
	
	
| // #include "res://addons/rokojori_action_library/Runtime/Shading/Library/Normals.gdshaderinc"
 | |
| 
 | |
| vec3 scaleNormalMap( vec3 normal, float scale )
 | |
| { 
 | |
|   normal -= vec3( 0.5 );
 | |
|   normal *= scale;
 | |
|   normal += vec3( 0.5 );
 | |
| 
 | |
|   return normal;
 | |
| }
 | |
| 
 | |
| vec3 addNormalMaps( vec3 a, vec3 b )
 | |
| { 
 | |
|   a -= vec3( 0.5 );
 | |
|   b -= vec3( 0.5 );
 | |
| 
 | |
|   vec3 result = a + b;
 | |
| 
 | |
|   return result + 0.5;
 | |
| } |