TNM084 2019 Lab 2:
OSL shader programming

The aim for this lab session is to get you started with OSL shader programming, more specifically OSL shaders for Autodesk 3dsMax. My brief tutorial on how to get started is linked below. More information can be found in the help system for 3dsMax, and in online resources like the OSL specification (linked from the main course page). Sadly, there are still only very few examples and tutorials available online, but most of the material written for Renderman SL (RSL) is at least generally applicable, and OSL is very similar to RSL both in terms of purpose and syntax. A lot of RSL code is actually valid OSL code, and at least some RSL shaders may work as OSL shaders with only minor edits.

Your own computer?

To perform this exercise on your own computer, you need Microsoft Windows. Sorry, but 3dsMax is not available for other platforms. Autodesk has an offer for students at LiU to download a copy of their software for free. It's not restricted in any way, but you are not allowed to useiot for commercial purposes. If you want to install 3dsMax on your own computer, visit and find the link at the bottom of the page named "Students and educators". There you will find isntructions on how to register an account with them to download and install 3dsMax. Version 2020 should work just as well as version 2019 which is installed in the course lab, but you will not be able to share files between the two versions freely.

Submission for grading

To get a pass grade on the lab exercise, you should write an OSL shader for 3dsMax, connect it to one or several of the map channels for the material of a simple object, and render an image to show your result. The image shold be of size 1024x768 pixels and on JPEG format. To submit your result for grading, use this form: