Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
Community
3ds Max Shading, Lighting and Rendering
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max materials topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OSL tip of the day.

58 REPLIES 58
Reply
Message 1 of 59
madsd
7991 Views, 58 Replies

OSL tip of the day.

Hello,

This thread is about using OSL shading and small tips to generate various effects.

 

The first one is edge wear masking.

See node setup and output below, it is useful for creating worn edges, metals and so forth.

You can find AO shaders online or use the one I attached here.

https://www.dropbox.com/s/lkg5zvjouhczujb/BaAmbientOcclusion.osl?dl=0

 

- Set to convext+concave ( mode 2 )

- Use noise to drive edge distance
- Use range node to scale the differences up

2018-04-21_15-36-41.jpg

 

 

58 REPLIES 58
Message 2 of 59
madsd
in reply to: madsd

Animated fractal dots.

You can download the shader and play around.
It is no problem rendering millions of dots instantly, and it takes zero memory.

 

The best part of OSL is that we can compile the shaders on the fly, inside the application, so tweaking and building is very close to the output.

 

 

Link to shader here:

https://www.dropbox.com/s/yw3ejfo66kpx8e3/FlowerFractal.osl?dl=0

 

 

2018-04-23_09-50-49.jpg16384_points.jpg2018-04-23_09-51-03.jpg

Message 3 of 59
madsd
in reply to: madsd

Here is an easy way to make landing lights on a runway.

 

werwerwer.gif2018-04-26_12-05-17.jpg

Message 4 of 59
Anonymous
in reply to: madsd

Those are great. Thanks @madsd. Very much appreciated!

Message 5 of 59
madsd
in reply to: Anonymous

Glad you like it!

More to come, drop by drop 🙂

 

Message 6 of 59
madsd
in reply to: madsd

Tip of the day today is about tapping into core nodes to build a randomizer.


In short we build a network that randomly distribute bitmaps based on a weight probability as well as randomly rotate the bitmaps on a set of instances.

This can be useful for randomization on scattered instances of any kind.

 

 

Message 7 of 59
madsd
in reply to: madsd

Todays tip is a very simple particle star scroller.

Just plug in a UV cooridinate and animate the time slider and you got a classic 3D particle star scroller going!

You can also project the 3d star cloud into Volume shaders and fly around the star field.

 

 

2018-05-02_22-52-04.jpg

Message 8 of 59
fla3d
in reply to: madsd

This is all really amazing, thank you!

Message 9 of 59
madsd
in reply to: madsd

Fractal pattern generator, useful for tiling or just a base for working with animated pattern effects.

 

https://www.dropbox.com/s/nj6pcx21bcxp6uu/gugu.osl?dl=0

qweqweqweqweqwe (1).jpg

Message 10 of 59
aaronfross
in reply to: madsd

Incredible stuff Mads, thanks a zillion.

Message 11 of 59
madsd
in reply to: madsd

Today is shape day!

 

I golfed a base and worked with Martin Breidt over a session and we came up with something like this.

 

You can make base shapes with this one, triangles, squares, star shapes, tile them, make patterns.

For tiling you need to add a UVTransform to "Po" on this node. then tile.

 

I mean to look into chamfering corner feature as well. You can ofcourse map front and back like you want.

LINK:
https://github.com/gkmotu/OSL-Shaders/blob/master/Shapes.osl

 

Shapes.gif

 

Message 12 of 59
madsd
in reply to: madsd

Let's do another one today!

 

Here comes base rain, it goes into your Normal/Bump.

It may be developed further in the future.

 

https://github.com/gkmotu/OSL-Shaders/blob/master/Base_Rain.osl

 

Base_Rain.gif

Message 13 of 59
madsd
in reply to: madsd

I wrote a procedural OSL noise that tiles seamlessly over uv borders to replicate a node functionallity from substance.

Non of the shipping legacy noises can do this.

 

Initially integrated Perlin and Voronoi, but can integrate any noise type needed ofc.

 

You can read about the featuresets I exposed in the shader as well as download the shader here:

https://www.masd.dk/osl-shaders-tile-noise/

 

TileNoise_experiment_01.gif

Message 14 of 59
Anonymous
in reply to: madsd

Hi, I enjoy your great tips, I am trying to get the same effect with this project I am working on. I am using vray and 3ds max. https://vimeo.com/338949004

the script you wrote will it get the effect I am looking for?

Message 15 of 59
madsd
in reply to: Anonymous

Yes that is possible to make.

It's spheres scattered in a volume, we can do that with OSL.

You can see the star field gif above, it's the same more or less, just with added effects.

Message 16 of 59
igor.koltsov22EAG
in reply to: madsd

Sorry for the bump, it seems like the ambient occlusion shader crashes max 2020 but works in 2019 is this a bug in 2020?

Message 17 of 59
madsd
in reply to: igor.koltsov22EAG

This is what I get in 2020, works fine with Arnold.
Where does it crash?

dd.png

Message 18 of 59
MI66
in reply to: madsd

A lot of cool stuff in this thread, such as the tileable noise. Wish there were more Substance-esque nodes for OSL! 🙂

 

I can't figure out how to best use the shipping OSL noise in such a way that one uses the regular 3ds max noise map. With the legacy noise one can just plug in whatever maps they want to the black & white input slots, so the legacy map functions as sort of a mix map inherently which is super handy. The OSL noises seem to lack this functionality, and I can't figure out the best way to replicate this with the stock OSL nodes. Or am I totally wrong?

 

This is my biggest gripe actually with OSL, the fact that the UX of the nodes is behind the old maps that we're used to using. The OSL maps often don't enable the same workflows as quickly as the legacy stock maps they're supposed to modernize. This easily leads to me just wanting to use the old, slower maps since they don't require as elaborate a node setup. On the other hand I do like the modularity of the OSL maps which has clearly been the point of the system, but optimally we could have the best of both worlds - modularity and quick UX. 🙂

Message 19 of 59
madsd
in reply to: MI66

I agree on the UI front.
We are realtivly limited, we can introduce a couple of hacks but they do mess up the UI in other ways, and its only the arrangements, its not curve editor and gradient bars for example.
I use the Arnold RGBA and FLOAT Ramps for those 2, the UI can go full screen and you can be ultra precise due to much larger canvas to pull points around on.

There may/or may not - be some initiative reserach going on that could / or could not be implemented, some of the active users doing a lot of programming in OSL talks with the developers and feed back their experiences, my self included.

In case you want the updated tile noise with a phaze loop on the z axis you can catch it on the git.
https://github.com/gkmotu/OSL-Shaders/blob/master/TileNoise.osl

 

You can pipe the noise into the Interpolate nodes mix slot and change colors on the color slots.
ss.png

 

Message 20 of 59
madsd
in reply to: MI66

What kind of Substance nodes would you be interested in seeing as OSL nodes?

Technically, we can go beyond what Substance is capable off, unless its some fancy stuff that is substance app related, such as brushing and other non-pure shade space stuff.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report