Variables or registers in ISL

General questions about Indigo, the scene format, rendering etc...
User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Variables or registers in ISL

Post by galinette » Mon Feb 01, 2010 1:59 am

Dear all,

Is it possible to make assignements in ISL? This would help for making complex shaders. I would like to assign return values to variables (any name) or registers (predefined variable name set). Is that possible currently? Is it planned for the future development?

Etienne
Eclat-Digital Research
http://www.eclat-digital.com

User avatar
fenerolina
Posts: 141
Joined: Sun Mar 15, 2009 12:27 pm
Location: Pyrenees

Re: Variables or registers in ISL

Post by fenerolina » Mon Feb 01, 2010 2:44 am

Hi Galinette, don't know if I can help you but take a look at this thread:www.indigorenderer.com/forum/viewtopic. ... &hilit=isl and this as well:www.indigorenderer.com/forum/viewtopic. ... s&start=15.

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

Re: Variables or registers in ISL

Post by OnoSendai » Mon Feb 01, 2010 11:20 am

Hi Galinette, I was thinking of adding let statements, i.e.

let z = f(x, y)

so I may add those at some point.

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: Variables or registers in ISL

Post by galinette » Mon Feb 01, 2010 7:14 pm

Thanks, that will really help. I'm currently working on a 100% procedural ceramic tile material (soon to be uploaded) with random "misplacements" (shift, rotations) + random amount of joint plaster, bump, etc... That's quite a nightmare to define without assignments.

Also, the use of assignments would significantly reduce the amount of redundant calculation : today, when you need a calculated value several times, you need to recompute it redundantly (except if you make very smart optimizations in your interpreter, but I gess this is much more work to implement than assignments)

Etienne
Eclat-Digital Research
http://www.eclat-digital.com

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

Re: Variables or registers in ISL

Post by CTZn » Tue Feb 02, 2010 4:48 am

I'm currently working on a 100% procedural ceramic tile material (soon to be uploaded) with random "misplacements" (shift, rotations) + random amount of joint plaster, bump, etc...
I'm a fan of procedural shading, can't wait to see this one ! Clearly, in years the few bitmaps I used were (at most) baked procedurals. And sub-icon sized tiles for textiles bumps tbh.
obsolete asset

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: Variables or registers in ISL

Post by galinette » Tue Feb 02, 2010 9:45 am

Here is a first try. I'm not 100% happy of the overall look but the base features are there. What I wanted to do is to avoid the "perfectness" of usual CG ceramic tiles, especially the unperfect positionning of the tiles.

It's 100% procedural, and you can customize the edge shape, corner roundness, jerky positionning (shift+tilt), and the variable plaster thickness between the tiles. It's made of a 1/0 blend of ceramic and plaster so that materials colors & look can be easily changed without looking into the (long and messy) ISL code.
Attachments
ceramic-2.jpg
ceramic-2.jpg (123 KiB) Viewed 7182 times
Eclat-Digital Research
http://www.eclat-digital.com

User avatar
fenerolina
Posts: 141
Joined: Sun Mar 15, 2009 12:27 pm
Location: Pyrenees

Re: Variables or registers in ISL

Post by fenerolina » Tue Feb 02, 2010 9:57 am

:shock:

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: Variables or registers in ISL

Post by galinette » Tue Feb 02, 2010 10:01 am

fenerolina : whaat??
Eclat-Digital Research
http://www.eclat-digital.com

User avatar
fenerolina
Posts: 141
Joined: Sun Mar 15, 2009 12:27 pm
Location: Pyrenees

Re: Variables or registers in ISL

Post by fenerolina » Tue Feb 02, 2010 10:05 am

: époustouflant!

User avatar
psor
1st Place Winner
Posts: 1295
Joined: Sun Jun 25, 2006 1:25 am
Location: Berlin
Contact:

Re: Variables or registers in ISL

Post by psor » Tue Feb 02, 2010 10:55 am

fenerolina wrote:: époustouflant!
I agree! :mrgreen:

Galinette if you've some spare time at your hands it would be much
appreciated if you could do some small tutorials on ISL to do stuff like
this. I imagine a lot of people would be happy. ;o))


take care
psor
"The sleeper must awaken"

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

Re: Variables or registers in ISL

Post by CTZn » Tue Feb 02, 2010 11:25 am

That's going to be an usefull shader, top stuff !

Are you defining the tiles with one white lerp with a dark end ? Can you do (circular) UV remapping ?

Noobish questions but you are hitting my favourite playground :)
obsolete asset

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: Variables or registers in ISL

Post by galinette » Tue Feb 02, 2010 11:52 am

There is no lerp

Basically, I use a "piramydal" func:

def pyra(x, y) = min ( min ( x, 1-x ) , min (y, 1-y)
with x = fract(u) and y = fract (v)
This defines a periodic "pyramidal" 2d function from the u and v coordinates.

To smoothen the pyramid corners, I replace min by an hyperboloid : min_rounded (a,b)=(a+b+sqrt(2+(a-b)²)

Then I use the integer parts of u and v ( floor(u) and floor(v) ) to define a random 2d translation + rotation matrix, which are applied to x and y before the pyramid function. This shakes slightly the pyramid's positions.

Then I transform the shaked pyramids to ceramic plates profile : roundfunc ( clamp ( pyramids(...), 0, 1 ) )
Where roundfunc = sqrt(x*(2-x)) ( elliptic edge profile).

On one other side, I define the plaster height by a smooth noise()

And finally, I use a 1/0 blend between ceramic and plaster, where the criteria is whether the ceramic level is higher or lower than the plaster level : kind of "flood fill"

And I finish with some noisy bumpmaps.

Source is attached (but kinda messy). I'll upload something as soon as I have fixed everything!


What is the condition to make the circular remapping work? Everything is based on uv coordinates, so if these are correctly cylindrically remapped, that should work I suppose.

Etienne
Attachments
ceramic-procedural-disp.igm
(6.29 KiB) Downloaded 274 times
ceramic-procedural.igm
(6.49 KiB) Downloaded 292 times
Eclat-Digital Research
http://www.eclat-digital.com

User avatar
fenerolina
Posts: 141
Joined: Sun Mar 15, 2009 12:27 pm
Location: Pyrenees

Re: Variables or registers in ISL

Post by fenerolina » Tue Feb 02, 2010 2:36 pm

Really awesome material Galinette! Love the unperfect position of tiles!
Is there a way for a noobish like me to scale the tile size? It only measures 2,5cm.
Could the frequency of the waves in the tiles be too hight for that size ?
Thank you.

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: Variables or registers in ISL

Post by galinette » Tue Feb 02, 2010 7:41 pm

Fenerolina : actually, everything is governed by UV coordinates. The unit square (1x1 size) is exactly one tile. So if you UV-map with 1 UV unit = 10cm in scene, your tiles will actually be 10cm wide. Everything is well sizeable.

However this will stretch the bevels & plaster joints too. To change these, I need to explain how to do in the shader.

Etienne
Eclat-Digital Research
http://www.eclat-digital.com

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: Variables or registers in ISL

Post by galinette » Tue Feb 02, 2010 7:48 pm

Here is a closeup (width of dark zones : ~3mm) and displacement mapping.

I'm not fully happy with the specular reflection on the rounded edges, as there should be no sharp edge between the round part and the flat top. Maybe something is wrong in the subdivisions/displacement/smoothing

Etienne
Attachments
ceramic-disp-4.jpg
ceramic-disp-4.jpg (84.82 KiB) Viewed 7093 times
Eclat-Digital Research
http://www.eclat-digital.com

Post Reply
25 posts

Who is online

Users browsing this forum: No registered users and 25 guests