texture osl (OPEN SHADING LANGUAGE)
Open Shading Language is the programmable shading for describing materials, textures, camera and pattern generation. OSL was originally developed by Sony Pictures Imageworks for use in its in-house renderer used for feature film animation and visual effects, released as open source so it could be used by other visual effects and animation studios and rendering software vendors. It is a proven programming language used in many films.
纹理osl(开放式阴影语言)
开放阴影语言是用于描述材质,纹理,相机和图案生成的可编程阴影。 OSL最初是由Sony Pictures Imageworks开发的,用于其内部渲染器(用于故事片动画和视觉效果),并以开源形式发布,因此可以被其他视觉效果,动画工作室和渲染软件供应商使用。它是许多电影中使用的一种经过验证的编程语言。
With Octane V3.08 you can now create highly detailed textures using Open Shading Language. If you only have a little patience and can bear the "learning curve", you have a very advanced tool for creating textures. If you are interested in programming or if you are a programmer, you can produce almost endless variety of textures using OSL. Moreover, do not think of it as only texture creation, there are also Camera and Projection options. Briefly, it's like a treasure; discovering can take some time and it is worth spending time to learn OSL.
借助Octane V3.08,您现在可以使用开放阴影语言创建高度详细的纹理。如果您只有一点点耐心并且可以承受“学习曲线”,那么您将拥有一个非常先进的工具来创建纹理。如果您对编程感兴趣,或者您是一名程序员,则可以使用OSL生成几乎无限多种纹理。此外,不要只将其视为纹理创建,还可以使用“摄影机”和“投影”选项。简而言之,它就像是宝藏。发现可能需要一些时间,值得花时间学习OSL。
We will not explain OSL in detail in this section. Since this is a very broad subject, you can go to this link and start learning about Octane OSL. There are very detailed explanations there.
You can also find tutorials and examples from the web because OSL is an open source programming language.
我们不会在本节中详细解释OSL。由于这是一个非常广泛的主题,因此您可以转到此链接并开始学习Octane OSL。那里有非常详细的解释。
您还可以从Web上找到教程和示例,因为OSL是一种开源编程语言。
ASSIGN OSL TEXTURE TO MATERIAL
You can do this in Octane very simply. First create an Octane Diffuse material and open the Node editor. Drag and drop the diffuse material you created into the Node editor. Then select "OSL texture" from the "Image Textures" group on the left in the Node editor and drag and drop it into the editor area. Connect this OSL node to the "diffuse" channel of the diffuse material.
将OSL纹理分配到材质
您可以在Octane中非常简单地执行此操作。 首先创建Octane漫射材质,然后打开“节点”编辑器。 将您创建的漫射材质拖放到“节点”编辑器中。 然后从“节点”编辑器左侧的“图像纹理”组中选择“ OSL纹理”,并将其拖放到编辑器区域中。 将此OSL节点连接到漫射材质的“漫射”通道。
2- Select the OSL texture node. Once you have selected go to the "Code group" tab in the settings window on the right. As you can see here, you can do editing and partial creating operations. If you don't want to deal with writing code, you can use various scripted scripts in "Script Category". Right next to "Scrip Presets" section you can see scripts written for the relevant category. You can also change the script parameters under the same window of your selected script.
2-选择“ OSL纹理”节点。 选择后,转到右侧设置窗口中的“代码组”选项卡。 如您在此处看到的,您可以进行编辑和部分创建操作。 如果您不想处理编写代码,则可以在“脚本类别”中使用各种脚本脚本。 在“抄写预设”部分旁边,您可以看到为相关类别编写的脚本。 您还可以在所选脚本的同一窗口下更改脚本参数。
CREATING AND EDITING OSL TEXTURE
To do this, first press the "Editor" button as shown in the picture below.
创建和编辑OSL纹理
为此,首先按下“编辑器”按钮,如下图所示。
The editor that opens is the heart of OSL texture creation. You will write, compile and complete your code here. As we mentioned at the beginning, you can learn how to write OSL using the link we gave. Or you can find articles and tutorials on the Web.
打开的编辑器是OSL纹理创建的核心。 您将在此处编写,编译和完成您的代码。 正如我们在一开始所提到的,您可以学习如何使用我们提供的链接来编写OSL。 或者,您可以在网上找到文章和教程。
SAVING AND CATEGORISING YOUR OSL SCRIPT
You can save the scripts you wrote in the Editor window or create a new category. This process is quite simple, press the "Save" button. Win or Mac explorer window will pop up. By default, the plugin will take you to the folder where you will save the script. However, the place where you will save the scripts is "C:\Program Files\MAXON\ Cinema 4D R19\plugins\ c4doctane\ res\ osl_scripts" folder. Here you can also open a new folder and save your script into it. This creates a new category and you can see it in the OSL script window.
保存和分类OSL脚本
您可以保存在“编辑器”窗口中编写的脚本,也可以创建一个新类别。 这个过程很简单,按下“保存”按钮。 Win或Mac资源管理器窗口将弹出。 默认情况下,该插件会将您带到保存脚本的文件夹。 但是,将保存脚本的位置是“ C:\ Program Files \ MAXON \ Cinema 4D R19 \ plugins \ c4doctane \ res \ osl_scripts”文件夹。 在这里,您还可以打开一个新文件夹并将脚本保存到其中。 这将创建一个新类别,您可以在OSL脚本窗口中看到它。
Things to be aware of when using OSL
When using OSL, you may need to pay attention to some things. Now let's briefly explain them:
使用OSL时需要注意的事项
使用OSL时,您可能需要注意一些事项。现在让我们简单地解释一下:
Features and limitations
First of all you need to know the limits or what features to support or not support for writing OSL shader in Octane. We recommend that you read the "Features and Limitations" topic from this link.
特点和局限性
首先,您需要了解在Octane中编写OSL着色器的限制或支持或不支持的功能。我们建议您阅读此链接中的“功能和限制”主题。
crash sItuaTIONS
There are some crash situations, for example if an unsupported feature or a global variable (eg time parameter) is used in the script, Octane can crash. The only way to prevent this for now is you should be careful for writing the code.
碰撞情况
在某些情况下会发生崩溃,例如,如果脚本中使用了不受支持的功能或全局变量(例如time参数),则Octane可能会崩溃。目前防止这种情况的唯一方法是,在编写代码时应格外小心。
compIle matters
You may need to press "compile" when a predefined preset script is selected or modified. Especially if a render is not active in the live viewer.
复杂事项
选择或修改预定义的预设脚本时,可能需要按“编译”。尤其是在实时查看器中未激活渲染的情况下。
when you want to use external osl scrIpts
When researching on the web, you will find some examples of OSL shaders. You can use these examples, but you may have to change some (or even most). Some of the lines of code or commands may not work in Octane, since these OSL instances are implemented according to the core features of the respective software. For example, some of the code you see in the picture below is found on the web. When we try to use this code in the Octane OSL editor, we encounter an "Output" error because Octane OSL does not allow to use of multiple outputs at the moment. Only one output is available. So it's better to know the limits for writing OSL in Octane. In the future, we expect these limits are off.
当您想使用外部OSL脚本时
在网络上研究时,您会找到一些OSL着色器的示例。您可以使用这些示例,但可能必须更改一些(甚至大部分)。由于这些OSL实例是根据相应软件的核心功能实现的,因此某些代码行或命令可能无法在Octane中使用。例如,您可以在网上找到下图中看到的一些代码。当我们尝试在Octane OSL编辑器中使用此代码时,会遇到“输出”错误,因为Octane OSL目前不允许使用多个输出。仅一个输出可用。因此,最好了解在Octane中编写OSL的限制。将来,我们希望这些限制会消失。
Another example is what you see in the picture below. Here, the use of "col.x" to read the first component of the "col" parameter fails. The correct use is shown on the right. Adapting external sources to the Octane OSL will not be a problem as your experience with writing OSL increases.
另一个示例是您在下图中看到的内容。 此处,使用“ col.x”读取“ col”参数的第一部分失败。 正确的用法显示在右侧。 随着您编写OSL的经验的增加,使外部资源适应Octane OSL不会成为问题。
赶快留个言打破零评论!~