Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [osl]

OSL (Open Shading Language) is an open source language designed for creating materials, lights, etc. The ability to add custom OSL scripts for rendering with Cycles was added to blender in 2.65

0
votes
0answers
10 views

Custom OSL shader not working

I tried making a custom OSL shader, which takes a color, normal and Fac value as input, then uses the color input to make a diffuse closure (glossy closure made without the use of Color) and mix them ...
0
votes
1answer
46 views

How to make simple Lambert in blender Open Shading Language?

I'm beginner in osl my problem is I couldn't find Light direction in osl documention to make lambert lighting model ...
1
vote
0answers
25 views

object/mesh displacement in OSL script

I am trying to use an OSL shader to displace the verticies in a fish model to make the fish appear as though it is moving. This should be doable using a vertex shader, but I am new to blender and am ...
2
votes
1answer
56 views

How to make simple Fresnel in blender Open Shading Language?

I'm beginner in osl I want to make simple fresnel by Open Shading Language: my problem is I can't find view direction in osl documention ...
1
vote
1answer
17 views

Custom nodes on GPU?

I want to create a custom perlin noise node (NOT a node group, an actual scripted one), and be able to run it on GPU. Is this possible? OSL does not seem to be 100% supported on GPU, so is it still ...
1
vote
2answers
81 views

How to interpret output position values of Geometry node

I have a simple sphere with a material. And I want to know how understand information the Geometry node gives. I printed this information through OSL shader. Can somebody please explain to me why the ...
6
votes
1answer
390 views

Camera projection without generating UV's?

I'd like to project an image sequence onto arbitrary geometry without touching its UV's. I already tried the UV project modifier as well as a lamp as projector. Using the Mapping node within the ...
1
vote
1answer
65 views

OSL texture(…) image looks whiter

I use OSL texture(...) to perform a texture lookup of an image, succeed, but it always looks whiter than I use the Image Texture Node, Why? What's wrong?
0
votes
1answer
41 views

Bake a image appearing in a mirror

is It possible to bake a image appearing in a mirror from a certain angle of camera? What is the possible ways to do that? Can I do from OSL?
1
vote
1answer
45 views

Is there way to access animation-nodes attribute in object-material with OSL script?

In this example, I have assigned a velocity attribute with animation nodes and then trying to access the velocity attribute with OSL script in object-material. But it is not working, why ???
2
votes
1answer
58 views

How to use pointcloud_write(…) and pointcloud_search(…) ? (Open Shading Language)

I am learning Open Shading Language these days, but I don't know how to use pointcloud_write(...) and pointcloud_search(...), what does pointcloud actually mean ? how to create a pointcloud in ...
0
votes
0answers
22 views

Trouble importing a png while using “open shading language”

I am working on a project and using the Toon Kit plugin. In order to use this plugin, i must use the "open shader language" I have never used this before, so I am not very familiar with it. My issue ...
2
votes
1answer
206 views

How to animate musgrave texture?

I was looking for a way to animate a procedural texture when a stumbled upon this. I was wondering if there was a way to do something similar with a Musgrave texture. As in the other post, I would ...
1
vote
0answers
35 views

Turning on OSL breaks node material with Normal node [closed]

The following works with Open Shading Language unchecked in the Render panel but as soon as I check the Open Shading Language box, the material goes completely black. Adding an OSL script node in the ...
0
votes
0answers
24 views

Current object information inside OSL custom shader

I'd like to build a custom OSL Emission shader which behaves as follows: 1) Input parameters: float Initial = 0 // minimum emission intensity float Final = 1 // maximum emission intensity 2) ...
1
vote
0answers
39 views

New OSL Closures

There’s an interesting thing about updating OSL closures in blender. As principled hair BSDF was released a new function principled_hair() appeared but I can’t see ...
1
vote
0answers
40 views

Sky/directional occlusion in cycles material

I'm looking to create a node group which returns white for all upwards-facing regions that have a direct path to the sky - a simple example would be a 'snowfall' matte. I have the z-normal working ...
2
votes
1answer
107 views

OSL: Anomalous normals returned by getmessage(“trace”)

One approach to finding if a shading point P is inside another object in OSL includes firing a probe ray back towards the camera from P, and detecting, whether the first face encountered faces towards ...
8
votes
2answers
497 views

Fake Bool operation with OSL shader

I'd like to use OSL to build a shader that gives a conditional (for mixing materials and such) on whether an object is inside another object and has a lower priority. For instance, if I were to mix ...
3
votes
1answer
54 views

checker in 4 colors

Could someone tell me how I can create a checker in 4 colors in all faces? I have already made this: ...
4
votes
1answer
168 views

Blender crashes when enabling “true” displacement

I created an OSL shader (a 4D noise texture) and connected it to the "Displacement" output of my shader. I wanted this to be a animated micropolygon / adaptive subdivision displacement, so I enabled "...
1
vote
0answers
61 views

OSL: How does Cycles implement derivatives?

The OSL language specification contains the following functions: float Dx (float a), Dy (float a), Dz (float a) vector Dx (point a), Dy (point a), Dz (point a) vector Dx (vector a), Dy (vector a),...
1
vote
1answer
146 views

OSL trace() : how is the “shade ” parameter used?

In its description of the trace() function , The OSL language specification refers to: ...the optional "shade" parameter indicating whether or not the shader ...
0
votes
0answers
62 views

OSL script node: “object” input?

Is it possible to have an "object" input in a script node and how ? Thanks ! EDIT I guess I should rather use a string input (for the object name) and then retrieve the object. Something like this: ...
3
votes
1answer
199 views

OSL script node : detect if two object collides and output a bool

I would like to have a script node that would output a boolean depending of if two objects are intersecting or not. The goals is to use it in a mix shader and to hide / show my object depending of ...
1
vote
1answer
179 views

OSL: Can I use a closure as an input to an OSL script?

I'm experimenting with NPR materials in Cycles, in particular, half-toning and hatching. In order to make things work, I often have to bake the output of a Cycles shader to a texture map and, in a ...
1
vote
0answers
113 views

OSL tiles with rounded corners pattern

There's a huge problem with an OSL script rework from ngon-paradise.com I try to make shading possible along the XYZ (3 dimensional coordinates instead of 2 dimensional. I try to understand the core ...
1
vote
1answer
118 views

OSL string functions

I've read about string functions in OSL lang. specification but it didn't give a clear explanation how to use them correctly. I'm interested in void warning() and void error() functions. Are there ...
0
votes
1answer
107 views

OSL getattribute()

How to recreate "getattribute()" function and cycles attributes in OSL to use them in other render engines later.(Renderman, Arnold may have different attributes) Here's link the list of the common ...
3
votes
1answer
134 views

OSL Debugging with fprintf

I'm trying to use debug functions to achieve an unusual behavior with OSL in Blender. I'm trying to use the fprintf function but I'm getting the following error: <...
3
votes
2answers
87 views

External libraries within a shader

Can I call functions from external libraries (.dll or .a) within a shader script? I want to be able to communicate to an external process and/or write a "log" for each point in the surface of an ...
1
vote
1answer
122 views

OSL Struct SyntaxError

I'm trying to create a way to calculate imaginary numbers in OSL using the struct constructor. Here is the beginning of my code: ...
0
votes
1answer
64 views

OSL `noise_turbulence` function

I found that people use noise_turbulence function in noise writing. Also i noticed that it was used in wave texture node implementation using osl here:https://svn....
2
votes
1answer
142 views

How to specify a traceset in OSL

In the OSL spec, there is a an optional parameter in a trace call for a 'traceset'. I would like to restrict a trace to only hit the same object. The solution I have right now is to get the object ...
2
votes
0answers
48 views

OSL select function

I try to run a shader with this function: color albedo = select(steel,rust,pt1); where variables: steel & rust are color and variable pt1 is float(generated ...
7
votes
1answer
175 views

How to load an internal blender image using OSL?

OSL has the texture command that we can use to load image files and map in an object. Dfelinto made a nice video about it some years ago. https://www.youtube.com/watch?v=V5N2rnFtSlw We also have many ...
4
votes
1answer
213 views

OSL distortion effect

I have a simple math function that produce a saw-like pattern. The question is - How to apply a distortion effect to it? Here's an example of the code: ...
1
vote
0answers
181 views

OSL Volume in 2.79

I'm learning to work with OSL but it seems something has changed between Blender 2.79 and previous versions regarding OSL Volumes... ...
3
votes
1answer
181 views

What does luminance have to do with the blackbody node?

I have noticed that the blackbody node has a 'scale by luminance' in its OSL code. This is the code: ...
1
vote
0answers
40 views

How to view and edit OSL built in closures?

I am aware that OSL has some built it closures like diffuse(N), absorption() and others. Is there any way I can edit those? I want to view them and maybe edit them.
8
votes
1answer
975 views

Distance from the surface as an input node for use with volumetric materials

I would like to create a material that has a volumetric component whose local Density depends on the depth of each volume point below the surface. Can the information "how deep below the surface is ...
5
votes
1answer
153 views

How do I script simple math functions in OSL?

I can't figure out how to script a simple inverse square root function node like the math node. The OSL language spec is mostly over my head since I don't have any programming experience.
4
votes
3answers
228 views

Location of object in OSL

I'm running Blender 2.78 Using OSL, I am trying to find the location of an object. In the Node editor, I am in Shader Nodes for World. The object I'm trying to find is a UV sphere named 'MySun' and ...
0
votes
1answer
53 views

The shader is not animating

The shader I just ported doesn't work as intented. It should be animating on changing time property. Now it is like still image. ...
3
votes
1answer
112 views

OSL Popup Option

Is it possible to create an enum for osl, like how the glass shader offers choices for the formula used to render the glass? I've been doing some research but I have been unable to find any ...
0
votes
1answer
301 views

OSL Texture usage

My script is not returning values according to the inputs from my node script. Any assistance would be great. I'm new to osl scripts and can't seem to find any relevant pages regarding texture usage ...
3
votes
0answers
145 views

How to create OSL Refraction shader

Is it possible to create a refraction shader using OSL with parameters to control the angle it refracts to using the normal and the angle of incidence?
1
vote
0answers
46 views

how to use SunVector input with this osl node?

I recently downloaded an osl sky texture, but cannot work out how to make it work. It has a sunvector input on the node but I don't know how to use it. Any help is much appreciated. https://...
11
votes
2answers
1k views

Using image sequence of medical scans as volume data in cycles

I know it's possible to do this in BI, but I need your help to do this in cycles. For now, I have a setup to use an image sequence as volume but it only shows 1 slice/frame. I'm using generated ...
1
vote
0answers
404 views

Why OSL script is not showing the result?

I tried to copy the source of the Separate RGB shader but not getting the same result as the original Separate RGB node. Top Left: A copy of Separate RGB source taken from blender repo. Top Right: ...