(L) [2008/10/20] [phresnel] [Shaders in picogen (warning: big images)] Wayback!I've spent some hours to implement a simple shader system in picogen, and finally I've got rid of the purely line-based scene-script (i.e. parameter-lists can be split over several lines).
The color shader basically takes either a const-color, or a Height-Slang program R6->R to interpolate between those colors. Arbitrarily nested, of course, see below for the scene-description file.
More info on Height-Slang on [LINK http://picogen.org/documentation.php]
Please feel free to click the correspnding links below the images, if they are cut-off in your browser [SMILEY :)]
The first image I rendered was this very simple one, where I just took the height-value to interpolate between three colors:
[IMG #1 Image]
[LINK http://picogen.org/wip/2008-10-20/rumble-in-the-jungle.png]
Here I tried to build a more elaborate shader, but it ain't easy, and that thing is honestly ugly
[IMG #2 Image]
[LINK http://picogen.org/wip/2008-10-20/shaders-aint-easy.png]
Ohh, this is ugly, a bad try on implementing lava. But then I currently cannae set the luminance of a color (and setting color-values > 1 is a Bad Thing, but I did ...)
[IMG #3 Image]
[LINK http://picogen.org/wip/2008-10-20/lava-try.png]
Ah, lovely. A peaceful place for your meditation.
This time it's a special brdf that allows to distort the height-value of the outgoing ray. Again with Height-Slang.
[IMG #4 Image]
[LINK http://picogen.org/wip/2008-10-20/peace-1.png]
Same scene, different day time.
[IMG #5 Image]
[LINK http://picogen.org/wip/2008-10-20/peace-2.png]
Source files:
[LINK http://picogen.org/wip/2008-10-20/lava-try.ssdf]
[LINK http://picogen.org/wip/2008-10-20/peace.ssdf]
[LINK http://picogen.org/wip/2008-10-20/shaders-aint-easy.ssdf]
All in all, it's not fully ready, as BRDF-kernels and Color-kernels (give me a scientific name for those shaders, pls) are programmable, but still seperated.
regards
---
edit: I nearly forgot: for latest binaries (gnu+linux,32bit / windows 32) see [LINK http://picogen.org/get/]
to grind one of the ssdf-files, type Code: [LINK # Select all]picogen ssdf -f <filename> -w <width> -h <height> -s <ws|pt>
ws is for whitted-style, pt is for path-tracing.
in gnu-manner, you can also type the long forms:
Code: [LINK # Select all]-f|--filename
-w|--width
-h|--height
-s|--surface-integrator : -ws|--whitted-style|-pt|--path-tracing
For example, to run "peace", type
Code: [LINK # Select all]picogen ssdf -f peace.ssdf -w 800 -h 400 -s ws
One last note: I have disabled the huge_array<uint64>-class ([LINK http://ompf.org/forum/viewtopic.php?f=8&t=999 viewtopic.php?f=8&t=999], [LINK http://ompf.org/forum/viewtopic.php?f=6&t=1012 viewtopic.php?f=6&t=1012]) in the release builds to make this thing run under windows.
[IMG #1]:
![[IMG:#0]](images/9512a6a0b7048163a7544d2d90bb9ce5c8e65e2de84e6146269142a36e07c96e.png)
[IMG #2]:Not scraped:
https://web.archive.org/web/20110929143611im_/http://picogen.org/wip/2008-10-20/shaders-aint-easy.png
[IMG #3]:
![[IMG:#2]](images/4839763da7b9a6a7d7ef8aa843fd0ae30c515e9454e7297005d0a20a29511e7d.png)
[IMG #4]:
![[IMG:#3]](images/36aaec4a33e0bec53107776418bbe32b9cb52949ec6bcfccf3f034bf01267e13.png)
[IMG #5]:
(L) [2008/10/21] [beason] [Shaders in picogen (warning: big images)] Wayback!Great to see an update from you. I see you've changed your name... I didn't know that was possible, lol.
Never rendered lava before personally or studied it, but since it's glowing because it's hot... are you using blackbody formula? It may give you more realistic colors. Blackbodies *emit* light, not reflect (...), btw. Solid rocks reflect like normal though I guess. Anyway emission should be fine to be > 1.
I sympathize with your modeling woes on the snowy mountain scene. I think its very nice though. I really like the snow patches, those are awesome. It's a great beginning, wish it was higher res!
(L) [2008/10/21] [phresnel] [Shaders in picogen (warning: big images)] Wayback!>> beason wrote:Great to see an update from you. I see you've changed your name... I didn't know that was possible, lol.
Was a long and painful operation, with tons of bureaucracy [SMILEY ;)] (thanks again tbp+jacco+toxie(?))
 >> Never rendered lava before personally or studied it, but since it's glowing because it's hot... are you using blackbody formula? It may give you more realistic colors. Blackbodies *emit* light, not reflect (...), btw. Solid rocks reflect like normal though I guess. Anyway emission should be fine to be > 1.
No blackbody, just color, which means it's like emitting light, but actually when there's no sun, it's all black. It's a mean hack. But that would be a neat idea [SMILEY :)]
Anyways, as BlindSide said, I primarily wanted to show the flexibility of the new system.
 >> I sympathize with your modeling woes on the snowy mountain scene. I think its very nice though. I really like the snow patches, those are awesome. It's a great beginning, wish it was higher res!
Modelling is tough, glad I am the _programmer_, and glad it's procedural at least [SMILEY :D]
Hmm, that reminds I once hardcoded that into picogen, looks like I have to lookup that thing:
[IMG #1 Image]
(article on that: [LINK http://greenhybrid.net/archive/#anchor_203])
[IMG #1]:Not scraped:
https://web.archive.org/web/20110929143611im_/http://greenhybrid.net/archive/images/picogen_0023.png