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:
-rw-r--r--release/scripts/templates_osl/empty_shader.osl6
-rw-r--r--release/scripts/templates_osl/noise.osl18
-rw-r--r--release/scripts/templates_osl/wireframe.osl10
-rw-r--r--source/blender/editors/space_text/text_format_osl.c2
4 files changed, 35 insertions, 1 deletions
diff --git a/release/scripts/templates_osl/empty_shader.osl b/release/scripts/templates_osl/empty_shader.osl
new file mode 100644
index 00000000000..8526e0f2e9b
--- /dev/null
+++ b/release/scripts/templates_osl/empty_shader.osl
@@ -0,0 +1,6 @@
+#include "stdosl.h"
+
+shader name()
+{
+
+} \ No newline at end of file
diff --git a/release/scripts/templates_osl/noise.osl b/release/scripts/templates_osl/noise.osl
new file mode 100644
index 00000000000..e152824b192
--- /dev/null
+++ b/release/scripts/templates_osl/noise.osl
@@ -0,0 +1,18 @@
+#include <stdosl.h>
+
+shader noise(
+ float Time = 1.0,
+ point Point = P,
+ output float Cell = 0.0,
+ output color Perlin = 0.8,
+ output color UPerlin = 0.8)
+{
+ /* Cell Noise */
+ Cell = noise("cell", Point);
+
+ /* Perlin 4D Noise*/
+ Perlin = noise("perlin", Point, Time);
+
+ /* UPerlin 4D Noise*/
+ UPerlin = noise("uperlin", Point, Time);
+} \ No newline at end of file
diff --git a/release/scripts/templates_osl/wireframe.osl b/release/scripts/templates_osl/wireframe.osl
new file mode 100644
index 00000000000..193dc7ee925
--- /dev/null
+++ b/release/scripts/templates_osl/wireframe.osl
@@ -0,0 +1,10 @@
+#include "stdosl.h"
+#include "oslutil.h"
+
+shader wireframe(
+ float Line_Width = 2.0,
+ int Raster = 1,
+ output float Wire = 0.0)
+{
+ Wire = wireframe("triangles", Line_Width, Raster);
+} \ No newline at end of file
diff --git a/source/blender/editors/space_text/text_format_osl.c b/source/blender/editors/space_text/text_format_osl.c
index a815fb2c34d..f313e9a5f2a 100644
--- a/source/blender/editors/space_text/text_format_osl.c
+++ b/source/blender/editors/space_text/text_format_osl.c
@@ -144,7 +144,7 @@ static int txtfmt_osl_find_specialvar(const char *string)
if (STR_LITERAL_STARTSWITH(string, "shader", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "surface", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "volume", len)) i = len;
- else if (STR_LITERAL_STARTSWITH(string, "displacement", len)) i = len;
+ else if (STR_LITERAL_STARTSWITH(string, "displacement", len)) i = len;
else i = 0;
/* If next source char is an identifier (eg. 'i' in "definate") no match */