summaryrefslogtreecommitdiffstats
path: root/Scripts/generate_shader.py
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2023-01-25 21:55:31 -0800
committeryum <yum.food.vr@gmail.com>2023-01-25 22:40:22 -0800
commite5da172a85368551954332836e52d2c98b37edec (patch)
tree2a156fb8a2c644d1149efd4fe2c18a43f98a0c49 /Scripts/generate_shader.py
parentdb83b6b1fef7c830bd13c1c9c71ce9ab4c47f215 (diff)
Finish basic PBR shading
TaSTT shader now uses physically based rendering (PBR). Users can pick smoothness, metallic, and emissive. This implementation borrows heavily from catlikecoding.com's excellent tutorials, which are released under MIT No Attribution (MIT-0). https://catlikecoding.com/unity/tutorials/license/ To retain what little clarity remains in the shader, I have chosen not to attribute the code in the source itself.
Diffstat (limited to 'Scripts/generate_shader.py')
-rw-r--r--Scripts/generate_shader.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/Scripts/generate_shader.py b/Scripts/generate_shader.py
index 5ad9e70..9ff0bc3 100644
--- a/Scripts/generate_shader.py
+++ b/Scripts/generate_shader.py
@@ -132,22 +132,22 @@ if __name__ == "__main__":
nrows = int(args.rows)
ncols = int(args.cols)
- replacement = generateUnityParams(nbytes, nrows, ncols, prefix = " ")
+ replacement = generateUnityParams(nbytes, nrows, ncols, prefix = "")
#print(replacement)
macro = "// %TEMPLATE__UNITY_ROW_COL_PARAMS%"
- assert(applyLineMacro(args.shader_template, args.shader_path, macro, replacement) == 1)
+ applyLineMacro(args.shader_template, args.shader_path, macro, replacement)
- replacement = generateCgParams(nbytes, nrows, ncols, prefix = " ")
+ replacement = generateCgParams(nbytes, nrows, ncols, prefix = " ")
#print(replacement)
macro = "// %TEMPLATE__CG_ROW_COL_PARAMS%"
- assert(applyLineMacro(args.shader_path, args.shader_path, macro, replacement) == 1)
+ applyLineMacro(args.shader_path, args.shader_path, macro, replacement)
- replacement = generateCgConstants(nbytes, nrows, ncols, prefix = " ")
+ replacement = generateCgConstants(nbytes, nrows, ncols, prefix = " ")
#print(replacement)
macro = "// %TEMPLATE__CG_ROW_COL_CONSTANTS%"
- assert(applyLineMacro(args.shader_path, args.shader_path, macro, replacement) == 1)
+ applyLineMacro(args.shader_path, args.shader_path, macro, replacement)
- replacement = generateLetterAccessor(nbytes, nrows, ncols, prefix = " ")
+ replacement = generateLetterAccessor(nbytes, nrows, ncols, prefix = " ")
#print(replacement)
macro = "// %TEMPLATE__CG_LETTER_ACCESSOR%"
- assert(applyLineMacro(args.shader_path, args.shader_path, macro, replacement) == 1)
+ applyLineMacro(args.shader_path, args.shader_path, macro, replacement)