OSL Templates:
* Add 3 simple templates: ** empty_shader.osl: A basic shader declaration to start with ** wireframe.osl: Simple wireframe shader ** noise.osl: Simple noise shader, with 3 noise types.
This commit is contained in:
6
release/scripts/templates_osl/empty_shader.osl
Normal file
6
release/scripts/templates_osl/empty_shader.osl
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "stdosl.h"
|
||||
|
||||
shader name()
|
||||
{
|
||||
|
||||
}
|
18
release/scripts/templates_osl/noise.osl
Normal file
18
release/scripts/templates_osl/noise.osl
Normal file
@@ -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);
|
||||
}
|
10
release/scripts/templates_osl/wireframe.osl
Normal file
10
release/scripts/templates_osl/wireframe.osl
Normal file
@@ -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);
|
||||
}
|
@@ -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 */
|
||||
|
Reference in New Issue
Block a user