Universalshader GPU v1.3.2 (New! Spectral Environment)

1.3.2 UPDATE: Bugfix
1.3 UPDATE: I have added a complete ENVIRONMENT conversion and full wavelength calculation!

PLEASE Filter Glossy on 0! Cause else you miss the beautiful color caustics! Use clamp or dispersion roughness instead (not too much).

You can get it from here: http://www.blendswap.com/blends/view/71195

V 1.3.2

-Bugfix (absorbtion socket)

V 1.3.1

FIXED SSS mistake !

V 1.3

  • Added wavelength environment node ! Simply put it as the environment texture, attach an image to it, and voala, you have a NONoverexposed, SPECTRAL environment! It includes gamma and HSV preprocessing controls for the image. It converts/remaps any image to wavelengths, also LDR. It is not an RGB splitter, but true float wavelength remapping with curves!

  • Added wavelength absorbtion settings to ALL shaders + the option to mix with the usual color input.

  • Added Fresnel to Transparency

  • Fixed internal routing, some default organisation and other minor things

NOTE Regarding the spectral environment node:

Cycles can handle wavelength data renders in float, but is NOT an unbiased full spectral renderer. Meaning that the wavelengths calculated here are only 9 separate value spikes in the full spectrum (like laser). A true blackbody emission would mean a full spectral emission with infinite/interpolated frequencies! This is the theory.

BUT you won’t make the difference to a luxrender, even if the wavelengths are NOT interpolated IF you set your scene CORRECTLY! Also it is WAY faster than an unbiased rendering! (but a little bit slower than normal)

Volumetrics are due to actual node limitations on hold. 2.7 is coming!

V 1.2

  • Added spectral based dispersion in nanometer from NearInfrared to NearUltraviolet. From 730nm to 410nm. Dispersion is separated internal by All shaders socket. Maximum GPU speed. Has its own socket with organised nodes! Plug and play!

  • Added Wavelength based Emission and mixable with the normal emission color.

Note: Always use at least 0.001 Dispersion Roughness! Light refracts always with little roughness (aberration) ! Else you will have some black corners depending on the geometry > no energy transport to the infinite small edges !

Also the wavelength settings are in NANOMETER (ex. 450, else you see nothing!), NOT 0 to 1! Simply enter the nm that are written in each setting (Green 530nm) I put range limits for each color(+/-10nm) for not going beyond the spectral limits bumping into each other with the mouse, but you can numerically making things like real thermal/IR renderings, etc…

V 1.1

UPDATE! Up to 300% faster depending on shader!

  • Internally rerouted for direct output of each shader and combinations

  • Added Output sockets for separate FAST GPU computing: Diffuse, Diffuse+Glossy,Translucency,Transluc+Glossy, Refraction (incl Glass option), Refraction+Glossy, SSS+ Glossy, SSS, Velvet, Velvet+Glossy, Hair (incl. Fresnel), Emission, Emission+Glossy and the SSS Displacement & Displacement passtrough.

  • Now it runs at MAX GPU speed due to direct separate sockets.

V 1.0

  • Added SSSgpu from blazraidr
  • Added Velvet shader with additional Fresnel
  • Added Hair shader with complete I/Os and additional Fresnel
  • Added Translucency shader
  • Added Displacement Passtrough (for easier workflow)
  • Reorganised colors and internal grouping
  • Renamed each MAIN node input for easier reading.
  • Kept energy balance across all shaders
  • Kept computation holdout if a shader is not used.

SSS works with front scattering also. Don’t forget, if you forget the SSS contrast value, press simply e.
(don’ forget, if you forget… LOOOOL :-D, i’m nuts :-P)
Always begin with the default values. (-3.000, 8.000 and e=2.718) and tweak from there.
I simply replaced the SSS branch mix, so energy conservation should remain correct.

If m9105826 could further optimize with blazraidr together the Ubershader would be great.
For example to have the absorption for other tasks too, like fog (would mean a smart internal setup).
I am not a node/math guru like them… :stuck_out_tongue: But as far as i can do…
UPDATE: I will later try to do add a pure volumetrics shading for atmosphere and water. Still if someone wants to add it, you’re welcome :-).

The SSS has already its own SSS Color and Bump inputs, so it’s logical to set the main difusse to 0 !

For beginners: If you already have the Ubershader assigned, remove (don’t disconnect only!), then mark Shift+click the X to delete, save, quit, and then append to this blend file. So you don’t get confused by two versions. Or you can also rename the new GROUP (not shader!).

Have fun.

It would be great to have a universal shader in the main branch! :slight_smile: especially for newcomers.
One material, endless shading. What i really wanted to do (but can’t?) is to have browsing for textures integrated, not only colors AND to select and collapse a defined group (by me) of values so that the shader is not so high like a mountain. LOL :smiley:

I do this for fun and my short animation i am working on heavily for 4K. Everything i do for Blender will be CC Zero! Many thanks for this wonderful software!

Always my great Thanks for your excellent job, enilnacs!

----- Thanks -----

Thank you.

Holy crap that’s a big node O_o
Nice :smiley:

Thank you, nice work!!

Hi Friend,
Could I have your blend file of the caustic test, please? to see the setup more accurately.
Thanks in advance+++

I have a question about the weight of the blend file in a great project:
Your node is weightness because it use instanciation for multiple materials or not aka it is duplicate x time in the file’s datas? You see my goal in this question! How reduce the size of a computer file?

Best Regards.

Its only the standard subdivided startup blender cube with the dispersion attached. Nothing more. Default values of the file above.
Simply download the blend above and delete susanne and put a subdivided cube. That’s all.

If you want to go into the nodes, everything is there easy sorted.

To your question. Everything should be instanced of course, even in spectral rendering. The materials take only an instance of the main shaders. It’s should be lightweight, only if you make yourself a user copy (which is usually unnecessary), THEN you have multiple groups. But this ist the reason this shader wants to avoid.
One shader, all materials.

PS: Although it also works on the CPU, it’s a pain in the a** :slight_smile: especially with spectral rendering :smiley: slow. GPU is king, this is the whole purpose of this shader. :stuck_out_tongue:

Ok for the cube…

But the use of your node: could I use it for 1000 different objects and to have a same file that with traditional nodes? I speak about Mega octet.

For the coder, I speak about how instanciate your node with a main core and send xml data to the core only by object to reduce his use in the blender data. You see what I mean?

Edit: Ok I understand your answer. I work with a very big blendfile: 3200 objects…all like in BGE with manually UV unwrap. I’m reassured now. I want to use Cycle for picture of the explanation for my BGE.

Yes, it will work :wink: There is only ONE group shader datablock, every object takes only property changes (like color, etc…).

Here i made a shell. INTERNAL DISPERSION :smiley: The same, only attached the Dispersion output to the internal faces. Done. :wink:
Gosh, there are so many possibilities! :stuck_out_tongue: I will do physical atmospherics and volumetrics, but first i have to sleep… :stuck_out_tongue: 24h up LOL :stuck_out_tongue: the passion, the passion… :smiley:

Good night Enilnacs (your name, difficult for my memory),

Ich weiß, dieses Leidenschaft auch. Hard to danach schlafen, ist es nicht?

Ok i have 2 images for Volumetrics:

This with absorbtion:

And this with SSSgpu:

Nodes, the transparency and the sss:

:slight_smile: Now, what i need to do is to add only (subtract) the transparency of the edges (first picture) quasi to use the first black picture to be “like” an alpha to the second… so i get soft edges.
BUT: you can’t subtract two shaders, mixing will keep the sharp edges and add is useless, AND i don’t want to use ANY compositing :smiley: v,1.3 has to be plug n play also…
ALSO, math will not work for BSDF shader ouputs… sadly.

ANY solution guys ? Maybe python ? I have no idea.

Although i KNOW that volumetrics are coming in 2.7, this should be faster, cause it doesn’t imply any real VOLUME calculations, beside the really FAST transparenncy node.

Maybe i’m tired and don’t see it… please HELP :smiley:

Well you called me to this in another thread, but what I can tell you is that you can try using the data from the layer weight node to fade out the shader to something completely transparent at glancing angles, essentially meaning that anything that is round and has no sharp edges can receive a sort of halo effect.

Also, the node right now is so long that most would have to pan down to see the whole thing while keeping the zoom at a readable level. Have you tried automating some of these things using math nodes and the like, because I don’t think you need to have 7 inputs for individual channels for dispersion for instance.

Hey, good idea, i will try that, let’s see… but i really hope i can somehow use the path node absorption with the layer weight…

ok tried, a LOT of combinations, but, the best i get is like you said only a halo against brighter background, the transparency is not kept against any background, cause the fresnel/layer weight is not a opacity transmitter but a face normal node. Will have to wait to some experimental volumetrics stuff… for now i will put it on hold.
Maybe some script guru can make this work, just maybe… but the volumetrics stuff is around the edge, lets see what nodes we get.

Still, MANY thanks Ace!

Great Thanks Anilnacs!

The point is that you need to have separate sockets to manipulate and be flexible. What is needed, are collapsable subvalues. For that you would need an subarrow for grouping and colapsing values. The moment you try to change flexibility and speed vs. internal math nodes, it gets painfully slow (cycles has to process each route).
Form should follow function, so i wait for collapsing arrows and gui subvalues in a node, also you simply cant automatize all inputs (most of the sockets), you need to adjust them…
Actually you can select shader combinations directly, as sockets.
i understand that this is not necessarily an ideal way with the actual node size, but way faster than connecting each time nodes. Its only scrolling, else plug’n’play. :slight_smile:

BTW, i have a trick, i always zoom out very fast with the mouse wheel and zoom in below or above. Also i work with big monitors 26xx resolution. 1600 vertical. Blender is a workhorse, no doubt :slight_smile:

For everyones sake, i will try and simplify it a bit, make a easier, more simpler version, without spectrality also… Stay tuned.

UPDATE, beside the wavelength inputs… i looked over it, but if you really want to have a plug and play shader, and don’t go into the node setup, you really need all the inputs… i mean, you can’t really remove vital inputs, and beside the additional wavelength inputs… everything is vital (IF you need a trulely UNIVERSAL :wink: shader, you never know what somebody uses, diffuse ? hair ? bump ? sss bump ?, so you have to route everything outside, else you take the artist INTO the group node, editing, routing, etc… but then whats the point of a plug and play shader. :wink:

I looked also at luxrender settings, octane settings, and others on my sistem… but, all are (some even more) huge when it comes down to inputs… :stuck_out_tongue: the only thing that we miss in blender are like i said, collapsing values in nodes (not only the whole node). With that alone, this node, would be 1/10 of its size :), you simply collapse the subshaders not needed.

Also the node switches are not really optimal and fast evaluated, so that you can like you said use math nodes. There should be a “route” node type that switches internally and if 0, it OMITS to evaluate that branch of subnodes. YES, then you can be fast internal… but until then… separate output sockets are better!

So i will keep it this way, and lets hope somebody makes collapsing node sub values and very fast evaluating routing nodes…

I have wanted to be able to try this out in your “Blender environment” mostly to see how the “spectral environment” is used and how well it performs i.e. running your " Universalshader1.3.2.blend " file.

I tried a few months ago, and all I get were black screens for the rendering (even in the viewport) so tonight (with a stock copy of your file) I tried it with 4 versions of blender 2.67, 2.7 ,2,7.05 and 2.7 with MTS (from Holyenigma’s build) and I always get the same thing? I noticed there is no image used in the “spectral environment” in this .blend file, and no environmental type of an image file. I tried some .jpg landscape scenes, but still a black screen render. Also if I select “material” as the “method to display” in the viewport, it freezes blender for a few seconds then it crashes and quits.

I’m using Windows 7 pro, GTX 580 and have Luxrender as the only extension in Blender.

Thank You

Ok, i don’t see any problem. Tested and used the default blend with even 2.71.
You need to attach an image and increase strength. See below:

Due to the nature of added wavelengths, the strength needs to be much higher than 1.0 to be visible. This is why you got black renders. Cause it is now float HDR which has naturally a much higher dynamic range to not overexpose. Also you can even use starlight to light the scene getting high enough strength values ;-).

Wow! Very nice Spectral Glass - AND CAUSTICS! I “faked” her left eye by putting a small BSDF matte “brown” sphere behind her, and it made some of the reflections a little strange, but I thought it was better then her left eye being clear/transparent.
This is a .jpg image, cause the .png was to large to upload to this forum.

I did this with the original .blend file except I lifted suzzane up higher , to see her entire shadow. I only used an area light (set at 9000 power! ) and turned off the “environmental node” and the world - and it still looks good IMHO. I wanted to see it in very simple direct light, so I could see more of “the simple truth”. I’m going to work more with those and see if I get a better result.

Oh ya, this 1000 passes at 1920x1080 in 48 minutes rendered on a overclocked GTX 580 - with a few minor adjustments to the rendering parameters shown below - Pretty amazing so far!