Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Molenkamp <github@lazydodo.com>2021-03-26 19:27:31 +0300
committerRay Molenkamp <github@lazydodo.com>2021-03-26 19:27:31 +0300
commitf560bc90c7e88f1d673f12779ea7df47278f8173 (patch)
tree5ac77400e33c190a766d33af93dd20d8d9d1d820 /release
parent689d6032ff5c42aea430161216c74abb67b7f50e (diff)
OSL: add basic OSL shader template
Add a basic OSL shader that shows how inputs and outputs work and do some simple math with them. This template is a happy medium between the templates we already ship, empty_shader is a little too bare, and the other templates are a little "too much" and you end up having to delete a whole bunch of stuff. a great starting point for some experimentation! Differential Revision: https://developer.blender.org/D9933 reviewed by: brecht
Diffstat (limited to 'release')
-rw-r--r--release/scripts/templates_osl/basic_shader.osl10
1 files changed, 10 insertions, 0 deletions
diff --git a/release/scripts/templates_osl/basic_shader.osl b/release/scripts/templates_osl/basic_shader.osl
new file mode 100644
index 00000000000..3c5240a1bbd
--- /dev/null
+++ b/release/scripts/templates_osl/basic_shader.osl
@@ -0,0 +1,10 @@
+shader basic_shader(
+ float in_float = 1.0,
+ color in_color = color(1.0, 1.0, 1.0),
+ output float out_float = 0.0,
+ output color out_color = color(0.0, 0.0, 0.0)
+ )
+{
+ out_float = in_float * 2.0;
+ out_color = in_color * 2.0;
+}