3.08 new features - Quick tutorial

Forums: 3.08 new features - Quick tutorial
3D Studio Max Plugin (Export Script Plugins developed by [gk] and KilaD; Integrated Plugin developed by Karba)
Forum rules
Please post only in English in this subforum. For alternate language discussion please go here viewforum.php?f=18

3.08 new features - Quick tutorial

Postby neonZorglub » Tue Mar 06, 2018 11:40 pm

neonZorglub Tue Mar 06, 2018 11:40 pm
Hi !,
This is a quick guide for the new version of 3dsMax plugin 3.08 RC1 - 5.01.
We are working on an updated documentation and proper tutorials, but as a quick start, here are some explanation and basic samples:

OSL Texture: let you write your own shader, to generate the pixel color of a texture.

See The Octane OSL guide there: https://docs.otoy.com/osl/index.html
and the threads viewtopic.php?f=33&t=65686
and viewtopic.php?f=33&t=63219

Here is a first set of samples:
3.08 samples for 3dsmax.zip
(351.15 KiB) Downloaded 332 times



OSL_ContextMenu.png


When you create a new OSL Texture, it has no shader file set.
You need to browse to select an existing OSL shader file.

**** creating an OSL shader from scratch ***
In your current max file folder, or in your favorite material folder, create an empty text file with a text editor, and copy this code:
-----
shader myOslTexture01(
output color c = 0)
{
c = color(0.8, 0.8, 0.1);
}
-----
save this text as fixedRGB_yellow.osl


You can now use and edit this osl file for your OSL Textures, and the dynamic parameters, if any, will appear in the texture dialog.
To open the default build-in editor OSL editor, select 'Edit' with right click on the OSL button.
Alternatively, you can use 'Edit with external editor', when you set the path to your text editor in the Trouble Shooting preference..
(eg, 'C:/Program Files (x86)/Notepad++/notepad++.exe')


Some basic OSL samples:

********** fixed color **********
osl_yellow.max.
Open the diffuse material "tstOsl01" in the material editor.
Select the Diffuse texture "myOslTx1"
Right click on the Osl button to see the available options and edit this shader.

********** red slider ***********
red_slider.max
Just to introduce a dynamic parameter, this let you set the red value of the RGB color with a slider in the material editor.
Note the parameter name 'Redness', and the min and max values

********** red and blue sliders ***********
red_blue_slider.max
Same idea as previous, 2 float values creating 2 sliders.

********** BGR image ************
bgr_image_tx.max
Introducing a 'color' input, that let you choose any Octane texture.
Here, we use a RGB image, and swap the red and blue values.

********** mix texture **********
osl_mix_textures.max
This shader behaves like the Octane Mix Texture,
Note that the 3 input parameters are dynamic and when the shader is compiled, corresponding dialog items are created, to let you edit those parameters.
For 'color' inputs, the convenient combo box allows you to use simple items (float value, color value, corresponding to a Float texture, and RGB Spectrum texture),
or select any of the Octane texture type.
It's now very easy to edit this shader to mix 3 or more textures !

********** Mandelbrot *****
Mandelbrot.max
This is a nice example of a more complex shader.

********** Fish Eye camera *****
oslCamera.max
This illustrate another usage of the OSL shader.
Using FishEyeCamera.osl shader from the OSL guide.

********** OSL Projection ****
osl_projection.max
Adapted from this thread: viewtopic.php?f=21&t=65575#
Thanks to calus !

********* OSL Errors and warnings **********
The texture dialog has a status line, showing 'Ok.' when the shader was compiled without any issue.
It will display an error or warning message if compilation failed.

To view the message in the editor window, right click on the shader name button, and select 'Edit'
You can then edit and try to fix the error, and re-save.
When the editor window is closed, the texture dialog will be updated.
neonZorglub
OctaneRender Team
OctaneRender Team
 
Posts: 892
Joined: Sun Jul 31, 2016 10:08 pm

Re: 3.08 new features - Quick tutorial

Postby wisemanxxx » Tue Mar 13, 2018 8:40 pm

wisemanxxx Tue Mar 13, 2018 8:40 pm
Anybody can help me?
I found this osl texture for interior mapping;
http://julius-ihle.de/?p=2451

This shader really good idea for mapping interiors on a plane.

But anyway to do this with spherical or cubic panoramas?
I want to place a 360x180 or cubic panorama on a plane with parallax mapping.

I tried something about osl projections but I can't found any examples.

I guess it can be solved with some osl projection code ..

Regards
wisemanxxx
Licensed Customer
Licensed Customer
 
Posts: 72
Joined: Wed Apr 27, 2011 7:48 am

Re: 3.08 new features - Quick tutorial

Postby paride4331 » Wed Mar 14, 2018 8:07 am

paride4331 Wed Mar 14, 2018 8:07 am
wisemanxxx wrote:Anybody can help me?
I found this osl texture for interior mapping;
http://julius-ihle.de/?p=2451

This shader really good idea for mapping interiors on a plane.

But anyway to do this with spherical or cubic panoramas?
I want to place a 360x180 or cubic panorama on a plane with parallax mapping.

I tried something about osl projections but I can't found any examples.

I guess it can be solved with some osl projection code ..

Regards


Hi wisemanxxx,
try taking a look here:
https://render.otoy.com/forum/viewtopic.php?f=33&t=63905&start=20#p326022
Regards
Paride
2 x Evga Titan X Hybrid / 3 x Evga RTX 2070 super Hybrid
User avatar
paride4331
Octane Guru
Octane Guru
 
Posts: 3686
Joined: Fri Sep 18, 2015 7:19 am

Return to Autodesk 3Ds Max


Who is online

Users browsing this forum: No registered users and 12 guests

Fri Mar 29, 2024 1:25 pm [ UTC ]