Jump to content

a shader each day


rdg

Recommended Posts

Another Day

I had the chance to speak as an opening act for "Oldschool Blog Live!" at Siggraph2008.

Well done and congratulations on your presentation! I'm sorry we didn't get a chance to meet up at SIGGRAPH..

This thread is very cool, by the way. Keep it coming:)

Link to comment
Share on other sites

  • 1 month later...
  • Replies 88
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Day 10: Lorem Ipsum was my Cradle Song

loremipsum_od.jpg

Slowly occluded toNDC() bricks with a hint of rotate().

Surprisingly bricksVOP got it's own lighting model, which I had to bypass to make it working without lights.

Most of the luminance() calls can be disregarded by working with floats instead of colors - I was just to lazy to substitute the brickVOP with something more efficient.

loremIspumwasmyLullaby.hip

Link to comment
Share on other sites

Day 11: XOR

hm ... not even sure if this is XOR but let's pretend it is ...

ray.jpg

A shader that emulates basic/java/flash boolean diplay writing.

eetu commented:

"(12:25:28 AM) eetu: yea, tracing sounds a tad overkill :)"

Well, but how to cookie this?

ray2.jpg

I first felt that this is the time for gather() ... but ...

Reading some of Mario's posts I guess a gather needs a rayimport and both can be in the same shader ...

Anyway a trace() looked quite right once I transformed my direction vector into space:current.

But now:

ray3.jpg

The same struction from above.

Some raytracing limit? Just right as eetu suggested?

I guessed that I need to limit my rays to exactly one hit, but this wan't work probably as the shading works top down.

XOR works bottom up.

Well, this is 3D and I'm not limited to Y down cameras ...

This is a shaded XOR and DOF:

ray4.jpg

this is the base geometry:

ray5.jpg

My shaders still look better without lighting model ...

ray6.jpg

...

rdg_XOR.hip

Link to comment
Share on other sites

Day 12: RDG vs Easing Functions

This not a shader.

post-960-1223056193_thumb.jpg

It's my first canny steps into the HDK.

I 'implemented' some easing functions as described e.g. at actionscript.org[1]

Not yet the standart Robert Penner Easing Functions [2] - most likely caused by my lack of c/c++ knowledge.

Thanks to Chip Collier and Mark Elendt I was able to have a function that takes more than two arguments :D

I compiled these on openSuse 10.3 64bit - I guess for other plattforms you have recompile them.

There is also a exhelp file, but how this might be merged to other existent files is a mystery to me.

It works fine, as I don't have any other exhelp files in $HOME/houdini9.5/help

Adds

* rdgeasein()

* rdgeaseout()

* rdgeaseexp()

* rdgeasecirc()

* rdgeasesin()

see exhelp rdg for details

rdgEasingFunctions.tar.gz

[1] http://www.actionscript.org/resources/arti...ning/Page3.html

[2] http://www.robertpenner.com/easing/

Edited by rdg
Link to comment
Share on other sites

Day 12: RDG vs Easing Functions

Hey rdg,

Looking good, but how are you implementing your ease function?

I haven't looked at your references, but AFAIK, the whole point of an ease() function (as an interpolation, not a spline) is that the slope at both ends is zero (a cubic spline with dydx=0 at the ends). I don't see that in your image (but maybe there aren't enough divs to show it?)... just curious.

Link to comment
Share on other sites

Hey rdg,

Looking good, but how are you implementing your ease function?

I haven't looked at your references, but AFAIK, the whole point of an ease() function (as an interpolation, not a spline) is that the slope at both ends is zero (a cubic spline with dydx=0 at the ends). I don't see that in your image (but maybe there aren't enough divs to show it?)... just curious.

ohm ... ahm ... well

What? :blink:

I guess easing might be the wrong term then.

The functions (easein, easeout, easeexp, easecirc, easesin) interpolate between 0...1.

E.g. :

fn easecirc(v) = -sqrt(1-v*v)-1;

Can the slope in an easein be zero at the end?

Edited by rdg
Link to comment
Share on other sites

ohm ... ahm ... well

What? :blink:

For those not on IRC... :)

I'm aware that there are an infinite number of ways to interpolate two values, and all these ways are valid. So there's nothing "wrong" with your function (I never said there was). However, it doesn't resemble Houdini's "ease" function, and I thought that was perhaps what you were striving to get.

Ease:

3 x2 - 2 x3

And ease with "bias" or "power ease":

3 x2*bias - 2 x3*bias

And the easep() family (second function above) looks like this:

post-148-1223061518.jpg

Link to comment
Share on other sites

However, it doesn't resemble Houdini's "ease" function, and I thought that was perhaps what you were striving to get.

I did't want to resemble Houdini'S ease, which I never got to work in SOPs btw.

The functions I compiled are more like shortcuts to different interpolation methods.

Link to comment
Share on other sites

fn easecirc(v) = -sqrt(1-v*v)-1;

Just doodling here...

Seeing as that function there is a 90 degree arc of a circle sqrt(1-(1-x)2), it occurred to me that there's a natural way to parameterize it...

Here's a "power" version of your "easecirc()" function:

easecircp(x) (always assuming x in [0,1], and bias>0):

pow(1-pow(1-x,bias), 1/bias)

This one is linear at bias=1, circle-arc (like yours) at bias=2, and inverse arc at bias=1/2.

post-148-1223066311.jpg

One more for your collection :)

Link to comment
Share on other sites

Day 13: Not implemented in Code

rdg_la_10_od.jpg

Yeah, it's Lorenz time again.

As the easing functions caused more confusion than good - apart from the missing discussion "expressions vs python: why the hassle anyway?" - I decided to take the next step.

The result is this LorenzAttractorSOP. Instead of mofifying incomming geometry like my pythonSOP [1] it generates the attractor on the fly.

10000000 iterations are easily generated - but they don't render ...

Even 999999 throw a DSO_ERROR every now and then.

But this is not a r3nd3rP0rn ... we want beautifikation.

rdg_la_5_od.jpg

rdg_la_6_od.jpg

rdg_la_2_2_od.jpg

[1] http://www.preset.de/2007/0711/lorenz/

Link to comment
Share on other sites

Actually, I have a python SOP of similar nature that might give you some ideas to try... Heh, if nothing else, you can yell at me for my Python implementation! :)

It's a graph of some random Calculus function I found on Wolfram Mathmatics site.

-j

SOP_fs_RiemannFuntionA.otl

SOP_fs_RiemannFuntionA.otl

Edited by jacob clark
Link to comment
Share on other sites

Day 14: Diffusion-Limited Aggregation

Thanks Jacob, if I ever knew about geo.createPoint() I forgot about it.

The tasks I tried to solve using the pythonSOP somehow shipwrecked most of the time on Houdini's SIMD/SMID/whatever approach. Creating new points instead of modifying existing ones is a good way to work around this limitation. But it often also requires a lot of dictionaries and structures to keep track of data and states.

I appreciate the pythonSOP for being a rapid prototype tool, but it's all about membership [1], isn't it?

Well, further experiments with a Clifford Attractor [2] and the HDK showed that it's currently been "Fortunes favours fools".

cliff_1_20_od.jpg

Not knowing enough about c++ arrays I had to strech this 2D structure into the third dimension: time evolves to space ... you get the point.

But his also allows me to work without Lyapunov exponents - the rate a system changes over time. No, not really, the exponent tells if a system is stable or chaotic.

Usually this value is also used to colourise the images. I accumulate the colour using an additive opacity shader.

The subtext is probably there is a lot more to explore in a vanilla Houdini before reaching out for the dark stars twinkling out there.

Ihab pointed me again to DLA - Diffusion-Limited Aggregation[3] - and we discussed if the HDK might be the way to get this running.

This being definitely out of reach for my c++ "skills", I got to resort in a POPnetwork.

Sure a pythonSOP might help here, but in my opinion this is close to creating the simulation in an external program and importing it into Houdini.

dla_3_3_od.jpg

The image shows an aggregated structure around a star shaped core after 15000 steps of simulation. I didn't remove the diffusing particles.

Here is a render of every 25th frame of this process: DLA Seq 3

As pagefan already pointed out: Nature's quite picky when it comes to parameters, And indeed it's a trial and select process finding the values that allow the particles to react. The obviously most dictating parameter is the diffusion algorithm, which I fake currently with a random walk. The angle a particle can go astray makes the difference. Depending on the parameters there are to many missing particles. Or they just accumulate to a big blob without growing the typical tendrils.

To optimize the process the system needs know at which rate the structure grows. This allows the diffusion particles to be born in a zone around the structure.

I am quite ego I found a way to solve this within POPs - without any fancy SOPsolvers and/or pushing geometry in/out of POPs.

It's been definitely a geek-y weekend here, but it was raining, if this is an excuse.

[1] Justice - DVNO: http://www.youtube.com/watch?v=0qPtx819idI

[2] Bourke, Paul, Clifford Attractors - http://local.wasp.uwa.edu.au/~pbourke/fractals/clifford/

[3] Wirtz, Franz-Josef, Diffusion-Limited Aggregation and its Simulation: http://www.gut-wirtz.de/dla/

Edited by rdg
Link to comment
Share on other sites

don't panic!

No, thanks for the link!

Very inspiring.

simulating the paths of millions of particles

This makes me wish again learning an auxiliary language. Not sure if an application like Houdini is even the right tool for such tasks.

But as Andy mentions Haeckel:

I cannot deny being a great fan of Haeckel myself.

This is the link to one of his books as on-line facsimile:

Ernst Haeckel:

Kunstformen der Natur

1899-1904

Link to comment
Share on other sites

  • 2 weeks later...

Day 15: SSS - SkypeSpriteShader

This one is a shader.

emotional_od.jpg

It uses the skype emoticon resource file and maps the anim of a random emoticon to a sprite.

So much for theory.

The file is a grid of 1500 animation frames and of course I lost track of the sequences sooner than later.

That's why the emoticons are popping in this sample animation

Here's another animation on vimeo: http://vimeo.com/2035099

emoticon-0147-emo.gif

Well, I used a VEX array and it's not a VOP VEX Surface SHOP!

emoticon-0147-emo.gif

rdg_SSSskypeSpriteShader.tar.gz

Of course the emoticons are intellectual property of Skype.com and I respect this fact.

Edited by rdg
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...