Shader tests

General questions about Indigo, the scene format, rendering etc...
User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Post by OnoSendai » Fri Sep 26, 2008 2:39 pm

Sure, eventually you will be able to apply shaders to media.

You will be able to control the scattering coefficients, absorption coefficients, and possibly eventually the emission properties of the medium.

That stuff will probably have to wait until the 1.2.x releases at least, though.

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

Post by OnoSendai » Fri Sep 26, 2008 6:10 pm

cpfresh wrote:oh man that grid code is so much nicer than mine :O Ono, is fract() going to be a permanent addition to the ISL? also, i see you used min in the grid shader, how are min and max defined?
yes, fract will be in.
min gives the minimum of its two arguments.

Big Fan
Posts: 745
Joined: Tue Oct 17, 2006 9:37 am
Location: Nelson NZ

Post by Big Fan » Fri Sep 26, 2008 6:36 pm

ok call me names but aside from some things like the 'brushed' effect I find these unconvincing..yup sure the maths is clever/'COOL' but the results are unconvincing..marble...yeah well not really...

what exactly are these shaders truly useful for? and I am not winding people up asking that
blender-lux has a lot of procedural texture stuff incorporated and try as I might to see them as worthwhile I find those practically useless to behold - sorry radiance :oops: .

come on dazzle me with something and prove me wrong - not arty farty matrix stuff, a real use :P

btw does is this shader preoccupation mean the end of adding genuinely useful stuff like full IES and rotating background maps?
a shift to shaders to do everything is going to be another UI rework and you know what I think about that :?

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

Post by OnoSendai » Fri Sep 26, 2008 6:51 pm

We're currently only scratching the surface of what can be done with shaders, Big Fan.

Also, the built in functions are only now nearing a decent set of functionality.

Anyway, we'll see how they work out.

Big Fan
Posts: 745
Joined: Tue Oct 17, 2006 9:37 am
Location: Nelson NZ

Post by Big Fan » Fri Sep 26, 2008 6:57 pm

..."scratching the surface"...

ok I'm a tough sell give me an example - linky winky? :wink:

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

Post by CTZn » Fri Sep 26, 2008 7:34 pm

Well BF if you think that's not convincing then you know better sources for marble in Indigo, or in absolute ? I don't, I'm convinced.

Come on here's your concern:
a shift to shaders to do everything is going to be another UI rework and you know what I think about that :?
and now admit these shaders are more versatile than plain textures.

As an artist I would use these, be sure of that (for fireplaces or such) :)
obsolete asset

Big Fan
Posts: 745
Joined: Tue Oct 17, 2006 9:37 am
Location: Nelson NZ

Post by Big Fan » Fri Sep 26, 2008 7:52 pm

No I dont think I am just avoiding UI work CTZn :D
I really dont know about this shader stuff so I am asking for examples..
fireplaces you say..hmmm..doesnt exactly set my world alight
where I live we ban all fireplaces anway :)

That marble just looks like a chocolate coloured maths model to me even sideways on :roll:

Honestly my rendering skill is not so hot so I'd like to hear from BbB for instance as a primo artiste about whether he would prefer to use these over a good texture.

How is this more versatile?
How many ways can you put checkers on a torus and remain sane :wink:
Are there paying jobs doing this I am missing out on?

To be fair to ono 'in my younger days' I was a maths nut too and would have loved to frolic wantonly in variables like this but you know fractal art just looks like... fractal art...all said and done.

I suppose if cornered I would admit there is nothing deeply wrong with messin' around with ingenious shaders as such even if it appears grossly disturbed to ordinary people -

I guess you could use em for an interesting feature painting in an architecture show home render for example but...well you know i'm sitting here and I'm thinking about tropical sea water, don't you :roll:

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

Post by CTZn » Fri Sep 26, 2008 9:24 pm

Versatility:

I have one single marble texture, it's 1024². I must put it on 32 objects, all must avoid showing features others show. For each, I'd use a different value of y as in:

sample2DTextureVec3(0, vec2(x, y))

Not an object will show the same features than any other, using a single, small texure. I'll save ram (31 textures), time (getting all these different, though of same material textures), and close-ups will be much better than gross pixels.

Agreed on complete artists opinion, like BbB. Though that depends on habits, I have started using bitmaps only with Indigo, and until now they were all baked procs.
obsolete asset

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

Post by OnoSendai » Fri Sep 26, 2008 10:20 pm

Yup, one important use of shaders, I think, will be to manipulate pre-existing textures so they can be applied to very large areas without tiling, and without excessive memory usage.

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Sat Sep 27, 2008 1:13 am

i'll also attached the reference image i used for the color sampling.
Now we're REALLY talking :D That's the best marble sofar :)

Ono: could 3D-volumetric texturing work via three textures/side? (meaning that there could be even more, for example, three scattering textures, three for absorption, three for glow and three for, uh, IoR*) With the current code already?

*scattering and absorption would be three channeled... emission maybe aswell. (Depends on RGB or Blackbody... In case of Blackbody, it would be TWO single channeled ones... One = bightness, second = temperature) IoR, Exponent, c_b_c or, if that actually makes sense inside a volume, normals (bumps) would be single channeled. And I wonder if blends of two of such materials would work...

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Mon Sep 29, 2008 3:26 am

http://freespace.virgin.net/hugo.elias/ ... perlin.htm
very interesting stuff about perlin noise functions and their use to make different textures :)
Especially the marble and wood examples further down the page are interesting :)

Youn
Posts: 18
Joined: Tue Dec 04, 2007 5:00 am

Post by Youn » Thu Oct 02, 2008 4:20 am

IMO those textures (the marble and wood) are horribly fake looking.

The clouds I think are maybe a bit better, but compared to a real sky is just very plain/uninterested looking.

I definitely can IMAGINE shaders being useful for realistic results but I've yet to be convinced. The most common situation may be to break up repeating tiled textures... so I'm looking forward to seeing this in an example...

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Thu Oct 02, 2008 5:59 am

Yeah, they are, but I didn't mean to directly convert them... Changing them a bit (or a lot) to get better results surely is possible... Though, it's a start for non-texture-based proper marble... (and also wood)

To get real looking clouds, you'd actually need codes to get all the different kinds of them...

http://en.wikipedia.org/wiki/Cloud

Oh, and don't forget that that's not a physically correctish render. Just very basic physics-correlation; absolutely unlike Indigo which tries to reproduce reality as close as possible...

MSUdom5
Posts: 159
Joined: Sun Jul 20, 2008 6:04 am
Location: Mississippi, USA
Contact:

Post by MSUdom5 » Tue Nov 04, 2008 4:15 pm

Wrote functions to convert between the RBG and HSL color models. Using HSL, one can perform color shifts and other effects. :)

Code: Select all

############################################################################
# HSL to RGB functions (from http://www.geekymonkey.com/Programming/CSharp/RGB2HSL_HSL2RGB.htm)
############################################################################

def computeV(vec3 hsl) real : if(lte(dotk(hsl),0.5),mul(dotk(hsl),add(1.0,dotj(hsl))),sub(add(dotk(hsl),doti(hsl)),mul(dotk(hsl),doti(hsl))))
def computeM(vec3 hsl) real : sub(add(dotk(hsl),dotk(hsl)),computeV(hsl))
def computeSV(vec3 hsl) real : div(sub(computeV(hsl),computeM(hsl)),computeV(hsl))
def computeVSF(vec3 hsl) real : mul(mul(computeV(hsl),computeSV(hsl)),fract(mul(6.0,doti(hsl))))

def computeRed(vec3 hsl) real : if(eq(floor(mul(6.0,doti(hsl))),0.0),computeV(hsl),
                                       if(eq(floor(mul(6.0,doti(hsl))),1.0),sub(computeV(hsl),computeVSF(hsl)),
                                       if(eq(floor(mul(6.0,doti(hsl))),2.0),computeM(hsl),
                                       if(eq(floor(mul(6.0,doti(hsl))),3.0),computeM(hsl),
                                       if(eq(floor(mul(6.0,doti(hsl))),4.0),add(computeM(hsl),computeVSF(hsl)),
                                       if(eq(floor(mul(6.0,doti(hsl))),5.0),computeV(hsl),0.0))))))

def computeGreen(vec3 hsl) real : if(eq(floor(mul(6.0,doti(hsl))),0.0),add(computeM(hsl),computeVSF(hsl)),
                                       if(eq(floor(mul(6.0,doti(hsl))),1.0),computeV(hsl),
                                       if(eq(floor(mul(6.0,doti(hsl))),2.0),computeV(hsl),
                                       if(eq(floor(mul(6.0,doti(hsl))),3.0),sub(computeV(hsl),computeVSF(hsl)),
                                       if(eq(floor(mul(6.0,doti(hsl))),4.0),computeM(hsl),
                                       if(eq(floor(mul(6.0,doti(hsl))),5.0),computeM(hsl),0.0))))))

def computeBlue(vec3 hsl) real :  if(eq(floor(mul(6.0,doti(hsl))),0.0),computeM(hsl),
                                       if(eq(floor(mul(6.0,doti(hsl))),1.0),computeM(hsl),
                                       if(eq(floor(mul(6.0,doti(hsl))),2.0),add(computeM(hsl),computeVSF(hsl)),
                                       if(eq(floor(mul(6.0,doti(hsl))),3.0),computeV(hsl),
                                       if(eq(floor(mul(6.0,doti(hsl))),4.0),computeV(hsl),
                                       if(eq(floor(mul(6.0,doti(hsl))),5.0),sub(computeV(hsl),computeVSF(hsl)),0.0))))))

def hsltorgb(vec3 hsl) vec3 : vec3(computeRed(hsl),computeGreen(hsl),computeBlue(hsl)) 

def eval(vec3 pos) vec3 : hsltorgb(vec3(clamp(fract(doti(mul(getTexCoords(0),5.0))),0.01,0.99),1.0,0.5))
And:

Code: Select all

def eval(vec3 pos) vec3 : hsltorgb(vec3(clamp(div(add(fbm(pos*60.0,5),1.0),2.0),0.01,0.99),1.0,0.5))
Attachments
fbm.jpg
fbm.jpg (50.44 KiB) Viewed 3139 times
stripes.jpg
stripes.jpg (40.69 KiB) Viewed 3139 times

User avatar
Borgleader
Posts: 2149
Joined: Mon Jun 16, 2008 10:48 am

Post by Borgleader » Tue Nov 04, 2008 11:01 pm

I'm loving the first of the two. Useful for making candy! :D
benn hired a mercenary to kill my sig...

Post Reply
223 posts

Who is online

Users browsing this forum: No registered users and 62 guests