ISL questions...

General discussion about Indigo Materials - material requests, material developement, feedback, etc..
User avatar
zeitmeister
2nd Place 100
Posts: 2010
Joined: Tue Apr 22, 2008 4:11 am
Location: Limburg/Lahn, Germany
Contact:

ISL questions...

Post by zeitmeister » Mon Dec 07, 2015 10:57 pm

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!
Cheers, David



DAVIDGUDELIUS // 3D.PORTFOLIO
·
Indigo 4.4.15 | Indigo for C4D 4.4.13.1 | C4D R23 | Mac OS X 10.13.6 | Windows 10 Professional x64

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Re: ISL questions...

Post by CTZn » Tue Dec 08, 2015 12:58 am

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.
obsolete asset

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Re: ISL questions...

Post by CTZn » Tue Dec 08, 2015 1:30 am

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.
Last edited by CTZn on Tue Dec 08, 2015 1:41 am, edited 2 times in total.
obsolete asset

User avatar
zeitmeister
2nd Place 100
Posts: 2010
Joined: Tue Apr 22, 2008 4:11 am
Location: Limburg/Lahn, Germany
Contact:

Re: ISL questions...

Post by zeitmeister » Tue Dec 08, 2015 1:39 am

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.
screen_01.JPG
Last edited by zeitmeister on Tue Dec 08, 2015 1:51 am, edited 1 time in total.
Cheers, David



DAVIDGUDELIUS // 3D.PORTFOLIO
·
Indigo 4.4.15 | Indigo for C4D 4.4.13.1 | C4D R23 | Mac OS X 10.13.6 | Windows 10 Professional x64

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Re: ISL questions...

Post by CTZn » Tue Dec 08, 2015 1:45 am

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.
obsolete asset

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Re: ISL questions...

Post by CTZn » Tue Dec 08, 2015 1:52 am

As far as a normal shader goes, I would use the help too :D
obsolete asset

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Re: ISL questions...

Post by CTZn » Tue Dec 08, 2015 2:00 am

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.
obsolete asset

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: ISL questions...

Post by OnoSendai » Tue Dec 08, 2015 2:20 am

And the more basic new fbm function:

http://www.indigorenderer.com/indigo-te ... oise-fun-0

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: ISL questions...

Post by OnoSendai » Tue Dec 08, 2015 4:44 am


User avatar
zeitmeister
2nd Place 100
Posts: 2010
Joined: Tue Apr 22, 2008 4:11 am
Location: Limburg/Lahn, Germany
Contact:

Re: ISL questions...

Post by zeitmeister » Tue Dec 08, 2015 4:53 am

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... :cry:
Cheers, David



DAVIDGUDELIUS // 3D.PORTFOLIO
·
Indigo 4.4.15 | Indigo for C4D 4.4.13.1 | C4D R23 | Mac OS X 10.13.6 | Windows 10 Professional x64

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: ISL questions...

Post by OnoSendai » Tue Dec 08, 2015 5:06 am

Ok will write a normal map shader.

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: ISL questions...

Post by OnoSendai » Tue Dec 08, 2015 5:19 am

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.

User avatar
zeitmeister
2nd Place 100
Posts: 2010
Joined: Tue Apr 22, 2008 4:11 am
Location: Limburg/Lahn, Germany
Contact:

Re: ISL questions...

Post by zeitmeister » Tue Dec 08, 2015 6:29 am

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
Cheers, David



DAVIDGUDELIUS // 3D.PORTFOLIO
·
Indigo 4.4.15 | Indigo for C4D 4.4.13.1 | C4D R23 | Mac OS X 10.13.6 | Windows 10 Professional x64

User avatar
zeitmeister
2nd Place 100
Posts: 2010
Joined: Tue Apr 22, 2008 4:11 am
Location: Limburg/Lahn, Germany
Contact:

Re: ISL questions...

Post by zeitmeister » Tue Dec 08, 2015 7:35 am

... and this is the carpaint material from Autodesk VRED:
vred_carpaint_editor.jpg
vred_carpaint_material.jpg
Very easy to setup and nice flakes. Voroni-based.
Indigo can do that better!!!
Cheers, David



DAVIDGUDELIUS // 3D.PORTFOLIO
·
Indigo 4.4.15 | Indigo for C4D 4.4.13.1 | C4D R23 | Mac OS X 10.13.6 | Windows 10 Professional x64

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: ISL questions...

Post by OnoSendai » Tue Dec 08, 2015 7:56 am

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.

Post Reply
29 posts

Who is online

Users browsing this forum: No registered users and 3 guests