Page 1 of 2
ISL questions...
Posted: Mon Dec 07, 2015 10:57 pm
by zeitmeister
Hi, I wondered how I implement a simple 3d noise shader without UV coordinates plus parameter sliders for scale? Which works in the bump or normal channel?
I can't find anything or any simple example.
Thank you in advance!
Re: ISL questions...
Posted: Tue Dec 08, 2015 12:58 am
by CTZn
Use
posOS() in place of
tex() for 3D placement.
pos can be used if the definition has that vec3 declared (NOT bump for instance).
So,
1. create a new (float) param
Name
2. add a noise (bump example below):
Code: Select all
fbm(posOS() * paramName(), 8) * 0.01
In ISL, a slider is identified by appending the prefix
param and the suffix
() to its name.
Re: ISL questions...
Posted: Tue Dec 08, 2015 1:30 am
by CTZn
A good practice for bump shaders is to divide the bump depth by the frequency (Name here) in order to maintain the same proportional height relatively to details frequencies.
Code: Select all
fbm(posOS() * paramName(), 8) * 0.01 / paramName()
When present in the definition signature -
def eval(vec3 pos) real: - pos will provide the
world space position of the point being sampled. PosOS() in turn will use the object space, so shaders will orient with the objects.
Sometimes however 3D shaders may look bad near the center of the space (kind of a fractal visual doppler effect). When using posOS() (object space) there is the option to move the geometries pivot point away in order to elude that centric artefact. Otherwise, 3d coordinates can be decomposed to shift the center by code:
(valid though untested exponent code)
Code: Select all
def eval(vec3 pos) real:
let
pos = vec3(
pos.x + 10.0,
pos.y + 20.0,
pos.z + 5.0
)
in
fbm(pos, 8) * 60.0 + 3.0
Here I hacked pos into a shifted coordinates system (base unit is meter of course). Hope this gets you started zeitmeister, ask for more if needed.
edit: Note that I'm not creating the variable pos, I'm copying its data; it was granted from scratch with the definition (def eval etc).
tip: you can not divide coordinates outright; you can however multiply them by the reciprocal of the value:
pos2 = pos * recip(12345.6789)
this is how you divide coordinates using Winter(?) as of now.
Re: ISL questions...
Posted: Tue Dec 08, 2015 1:39 am
by zeitmeister
Thank you! But how can I get another noise type, like simple NOISE, voroni or perlin?
If I simple replace "fbm" by "noise", I get an error. I don't get it.
Re: ISL questions...
Posted: Tue Dec 08, 2015 1:45 am
by CTZn
Noise don't have octaves, remove the coma and integer when switching the code from fbm. Noise is equivalent to a fbm with an octave of 1.
Seek ISL_stdlib text file in indigo application folder (windows), make a backup (you don't want to modify it or your materials may work locally only. At best.). Down the file you can learn about some more noise functions.
Re: ISL questions...
Posted: Tue Dec 08, 2015 1:52 am
by CTZn
As far as a normal shader goes, I would use the help too

Re: ISL questions...
Posted: Tue Dec 08, 2015 2:00 am
by CTZn
Then there's the infamous multifractal(1, pos, 0.0, 2.0, 2.0, 0.0) (off the top of my head) with the integer coming first defining the noise type, ranging 0-2. It's pretty advanced, tricky to tame really.
Noise type 2 is a 3d projection of a 2d voronoi...
I'm done for now, will check in back later tonight.
Re: ISL questions...
Posted: Tue Dec 08, 2015 2:20 am
by OnoSendai
Re: ISL questions...
Posted: Tue Dec 08, 2015 4:44 am
by OnoSendai
Re: ISL questions...
Posted: Tue Dec 08, 2015 4:53 am
by zeitmeister
Came a bit further, but I don't manage to transfer it to a voroni in the normal channel.
Sorry, but I really don't get it...

Re: ISL questions...
Posted: Tue Dec 08, 2015 5:06 am
by OnoSendai
Ok will write a normal map shader.
Re: ISL questions...
Posted: Tue Dec 08, 2015 5:19 am
by OnoSendai
Voronoi in normal map channel is tricky. Can't you just use it in bump channel?
Actually I noticed that voronoi basis is only using 2d voronoi noise in fbm(), it should be using 3d voronoi noise. Will fix.
Re: ISL questions...
Posted: Tue Dec 08, 2015 6:29 am
by zeitmeister
Actually I want to try to do a carpaint flake shader, based on a non-UV noise.
I had a look at the speckled carpaint shader, and I am not very satisfied with the look of the flake layer.
I think
this example is a slightly more sophisticated approach to a realistic look of the flakes.
I think it's definately possible with ISL; plus giving each "flake" a "rotation" with some kind of unique 3-color-gradient.
What dou you think?
Some examples of flakes:
http://www.fish-junkie.com/images/color ... Circle.jpg
http://distinctivdetailing.com/wp-conte ... -after.jpg
http://3.bp.blogspot.com/-WjyyHsw_oeE/V ... auty14.png
Re: ISL questions...
Posted: Tue Dec 08, 2015 7:35 am
by zeitmeister
... and this is the carpaint material from Autodesk VRED:
Very easy to setup and nice flakes. Voroni-based.
Indigo can do that better!!!
Re: ISL questions...
Posted: Tue Dec 08, 2015 7:56 am
by OnoSendai
The car paint I made (
http://www.indigorenderer.com/materials/materials/1322 ) uses randomly oriented facets in a grid pattern, I guess voronoi would be better.