Page 14 of 14 FirstFirst ... 4121314
Results 261 to 279 of 279
  1. #261
    short update,i think i found the missing code,yesterday was late.the code was at the beginning.but there is only one code chunck that is not clear to me what to do with that.i marked the code in the pic.i have all the other code rebuilded with nodes(only the red marked is missing).it reacts to different thickness values ,ior values,and lamdas (rgb lambdas).something is still not right.

    i guess, if the missing code piece is placed into the nodes, it is done.

    every helping ideas are welcome

    here the last build with lamda 650 for red.edit,here is the full code.
    https://www.gamedev.net/articles/pro...graphics-r2962
    Click image for larger version. 

Name:	thinfresnel2.JPG 
Views:	23 
Size:	284.3 KB 
ID:	499681
    Last edited by pixelgrip; 25-Sep-17 at 13:02.



  2. #262
    first thinfilm shader preview.

    Bacterius ,the developer from the thinfilm shader it self,was so kind to help me understand the code for rebuilding it in cycles.
    All credits belongs to him,since the whole cycles rebuild is based on his thinfilm shader code.

    since cycles has some limitations,i had to work around.the main difference in the node build is,that i have to use the incoming viewing angle dot product, to fake the incident light vector, that the original shader code uses to calculate the fresnel equations.

    this is the first render.the shader needs some optimizations,clean ups groupings,intensity controls and so on.

    Click image for larger version. 

Name:	thinnodes1.JPG 
Views:	15 
Size:	294.0 KB 
ID:	500095

    Click image for larger version. 

Name:	firstthinfilm1.jpg 
Views:	16 
Size:	1.06 MB 
ID:	500096
    Last edited by pixelgrip; 29-Sep-17 at 03:36.



  3. #263
    next update,i cleaned up the noodle mess,fixed one missing math node.next step is fixing the energie conservation,it behaves atm different in cycles vs the cpp code.

    Click image for larger version. 

Name:	cleanthin1.JPG 
Views:	20 
Size:	284.7 KB 
ID:	500309

    Click image for larger version. 

Name:	thinpre2.jpg 
Views:	25 
Size:	1.14 MB 
ID:	500310



  4. #264
    Member Secrop's Avatar
    Join Date
    Dec 2011
    Location
    Berlin
    Posts
    1,847
    Originally Posted by pixelgrip View Post
    next update,i cleaned up the noodle mess,fixed one missing math node.next step is fixing the energie conservation,it behaves atm different in cycles vs the cpp code.

    Click image for larger version. 

Name:	cleanthin1.JPG 
Views:	20 
Size:	284.7 KB 
ID:	500309

    Click image for larger version. 

Name:	thinpre2.jpg 
Views:	25 
Size:	1.14 MB 
ID:	500310
    I like this spectral gradient very much. I suppose you didn't used the wavelenght node, did you?



  5. #265
    Secrop you are right,no wavelength color node was used.Its used three different lamdas (650,550,440) into input value nodes ,and then the calculated result is connected to a rgb combine node at the end.



  6. #266
    thin film glass,with water inside

    Click image for larger version. 

Name:	thindrag1.jpg 
Views:	21 
Size:	1.06 MB 
ID:	500418



  7. #267
    i found the (hopefully) last mistake.last thing to do is grouping everything to one group.
    here a quick carpaint test. with min thickness 500nm and maxthickness 520nm .external IOR 1,thin film IOR 1.6,internal IOR 1.4
    into a glossy shader and a clear glossy on top as clearcoat.with calculated reflection fac within the thinfilmshader for the clearcoat (cos1)

    Click image for larger version. 

Name:	thincar1.jpg 
Views:	14 
Size:	837.3 KB 
ID:	500474



  8. #268
    i have grouped everything.maybe a more minimalistic version is usefull to,lambda should left at it is.and maybe not all angle factors are nessesary.but otherwise if someone need this settings,they are there..hmm.if no strange behavior apears it is done.

    Click image for larger version. 

Name:	thindrag2.JPG 
Views:	42 
Size:	223.9 KB 
ID:	500505



  9. #269
    Here are the Thin Film shader v1_3 for Download

    thinfilmshader_v1_3.blend

    thinfilmshader_pixelgrip_v1_2.blend

    credits and thanks goes to Bacterius ,the Developer of the Thin film shader code,rebuilded with Cycles nodes in Blender 2.79 by me.


    please report any error,to fix them.

    edit,v1_3 has a little fix.the phaseshift delta value was in a wrong order,after instead inside a multiply node.

    latest download has a little fix and simplyfied shader output,because since the cos1 ect has only the refracted angles data, its not very usefull at all,so i removed them.

    in this picture you can see reference colorramps (grazing angle at top to directly facing at bottom),that Bacterius rendered with his BRDF Explorer,with the settings below.
    As you can see ,the rendered spheres in Blender has the same color values (maybe a bit brighter ,cause i used a emission shader with str 1 for this)
    Click image for larger version. 

Name:	thinref1.JPG 
Views:	20 
Size:	168.9 KB 
ID:	500712
    Last edited by pixelgrip; 13-Oct-17 at 03:29. Reason: new version



  10. #270
    Member
    Join Date
    Apr 2012
    Posts
    1,791
    Looks great - will have a play with this tomorrow.



  11. #271
    Originally Posted by pixelgrip View Post
    Here are the Thin Film shader v1_2 for Download
    It looks amazing!

    Could you make some common materials (one or two should be enough) for example on how to use it in most proper way? I'm playing with it and results are decent but not even close to yours renders from above posts. I'm thinking about soap bubble as the most obvious thing and with leather as presented before in this thread.

    Also I'm wondering about using this shader with Principled and Micro-surface roughness, is this a good idea?



  12. #272
    Member
    Join Date
    Apr 2012
    Posts
    1,791
    The output of the Thin Film Shader is a colour - so you'd simply plug it into the colour slot of whichever shader you wanted to use it with (including principled).

    The Micro-surface roughness node group posted earlier in the thread affects the roughness value of a shader - so you'd plug that into the roughness slot of the shader.

    Thin film and micro roughness are mutually compatible.



  13. #273
    Originally Posted by moony View Post
    The output of the Thin Film Shader is a colour - so you'd simply plug it into the colour slot of whichever shader you wanted to use it with (including principled).

    The Micro-surface roughness node group posted earlier in the thread affects the roughness value of a shader - so you'd plug that into the roughness slot of the shader.

    Thin film and micro roughness are mutually compatible.
    That much I've figured out before. I can't make good looking soap bubble for example. Connecting just Thin Film Shader as colour obviously don't provide good result, best one is by mixing Glossy (with Thin Film Shader) with Glass but here as a factor I've used Layer Weight (Facing, only rim has thin film effect) or just mix factor (bubble is dark).

    Click image for larger version. 

Name:	1.png 
Views:	8 
Size:	567.5 KB 
ID:	501284

    Also how to properly mix Thin Film Shader colour output with material color (texture)?



  14. #274
    Hi doo,

    The color output ,from the thin film shader,is the reflected colorshift result ,from inside the film calculations.

    For a carpaint ,for example, you need a clearcoat on top,the thinlayer would be underneath the clear coat.so you can mix the film shader with your baselayer, or use it as baselayercolor,what ever you want to archive.

    here is a quick soapbubble,same method.clear reflecting layer + transparent layer.you can mix the transparent layer with the translucent shader to,for a bit different or disired result.

    maybe there is a even better method to simulating soap bubbles,maybe with glass shader and so on,just experiment.

    notice ,i have mixed in this example, two transparent layers. one for the pure transparency,and one for sim the reflected water/air color reflection.i have increased the colorvalue ,from the shader ,for more intense colors (its more a artistic value and usefull for this).
    if you use the translucend shader instead ,for the add to the pure transparancy,you can let the colorvalue as default to 0.

    and one important thing is,for color variations,swirls or whatever,you can use a bumpmap for thickness variations.the min and max values are in nm (nanometers) soapbubbles are around 150-700 max.the thickness input use normalized values (0-1)and calculate it automaticly to mix and max values .

    you can use a texture or heightmap ,as input for the thickness input to.

    hope that helps,would be nice to see some render results

    Click image for larger version. 

Name:	bubblev1_2.JPG 
Views:	15 
Size:	237.3 KB 
ID:	501320

    edit, here a carpaint example

    Click image for larger version. 

Name:	carpaint_v1_2.JPG 
Views:	14 
Size:	231.5 KB 
ID:	501356

    edit,carpaint with sparkles.

    sparkles are from Secrops method in this thread
    https://blenderartists.org/forum/sho...itter-material

    Click image for larger version. 

Name:	carpaintv1_2sparkle.JPG 
Views:	24 
Size:	284.0 KB 
ID:	501361
    Last edited by pixelgrip; 10-Oct-17 at 17:04.



  15. #275
    This is looking really neat. Pixelgrip, mad props for digging through the math and turning it into nodes.
    A few followup questions:

    How did you decide the values for the car paint? Color-shift paint like that is based on particles with metal thin films which I believe have much different IoR than in the example.

    Some materials have varying IoR across wavelengths, does this shader account for that?

    Long story short I have a few materials that use Prutser's OSL implementation of thin films - that one takes an n,K input with RGB-separated values for n and K. It gives very accurate results for things like metal oxide films, but is OSL so can't be used on GPU. I'd love to figure out how to convert that workflow over to this node group, but I realize that may not be possible based on the implementation.

    Thanks again for your amazing work on this!



  16. #276
    I'll say it again, amazing work!

    Here are some thoughts regarding not specifically Thin Film Shader, as this one is working fantastic, but ways to use it to create materials.

    First of all here is a soap bubble made with method you've posted above:

    Click image for larger version. 

Name:	bubble_trans.png 
Views:	6 
Size:	624.2 KB 
ID:	501365

    And here are my attempts with reference image and clean reflection:

    Click image for larger version. 

Name:	bubble_comp.jpg 
Views:	14 
Size:	266.6 KB 
ID:	501366

    First thing that I wasn't even aware is that bubble reflects environment in kind a reversed mirror way (sorry, I don't know english word for it) and also that it doesn't have Fresnel effect - which is too much visible in your method. Reflections seems to be uniform on whole bubble. Quick test with Principled showed that it's working only with Metallic = 1.

    But... With only Glossy and Transparent added (last example) reflections are too weak (?) so the Layer Weight helps a little bit. Still there is something I'm missing here.

    I've tested it wit lots of different HDRIs and results are completely different. I think this is the way it should be though.

    I'll make some bubbles and shot some photos at the end of this week and check if this is true.

    Thanks for different material setups, they are absolutely brilliant!

    Trough this week I'll experiment with use it with image textures, masks (spilled oil) and maybe some efficient way to use it with PBR materials (Principled).



  17. #277
    doo,your renders looks like they are going into the right direction,just experimenting further.would nice to see your spilled oil render then.

    your last node build seems to me not correct,the build before is correct with the glossy layer on top with the layer weight node.but the transparent node + glossy i am not sure.
    i have to look for the best method,if i find one, i posting this then.but if you want a more glossy bubble ,then increase the rgb curve more.keep in mind water has only a reflection around 3% at F0 direct facing.



    spiderbrigade,the shader is based on this thin film shader code
    https://www.gamedev.net/articles/pro...graphics-r2962

    the carpaint values are from a thinfilm paper i have seen,with a little bit variation from it.

    yes and no,it takes account different IOR variations.that is the main math behind the shader,this and the thickness from the filmlayer.but it uses only the IOR values the shader has,otherwise have to make 6 additional IOR inputs.but i think thats not necessary.

    you can even make custom IOR variations and feed that into the IOR inputs.

    just have a look in the posted link,and you see how its works.

    short explanation how it works.the shader calculate the fresnel-equations from the values are given.it calculates the transmitted angle into the film and based on the thickness and given lambda the wavelength in the film change.so at the end you see what happens to the given wavelength if the light travels through the film and reflect back from the internal layer.that is the color output then.

    for reference, you can see in the shader post #269 the colorramps and the shadercolors are identical,so the shader seems to do the work correct,but i have tested some other refernce values, i have found in the net ,that doesnt match.

    i have to talk to Bacterius (the shader developer) about this.

    as base,artisticly it works,i have double checked every nodes,could not find any mistake.and like i said,the colorramps match.so i lets wait what Bacterius says.

    the rgb lambdas ,are more or less artistic choice too,i have ask Bacterius about his lambda choice.
    in the thinfilm paper i talked about,they are useing 580,550,450.Bacterius uses 650,510,475

    in the latest rendering i used 650,550,450.you can found many values about the primary color wavelengths and eye sensitivity and what not,so you can experiment with this too.keep in mind, it used the same calculations and combine these as rgb at the end,so the differents should be minimal.
    Last edited by pixelgrip; 10-Oct-17 at 20:41.



  18. #278
    short update.i found and fixed a little mistake ,that was given false internal IOR results.i update the file version later.next and last step is then the k absorbtion implementation (50/50 chance that this will happen,depents on the equation,if this gets to complicated then not).here a quick bubble render.

    edit,v1_3 is uploaded


    Click image for larger version. 

Name:	bubble_1_3.JPG 
Views:	20 
Size:	197.7 KB 
ID:	501565
    Last edited by pixelgrip; 13-Oct-17 at 03:34.



  19. #279
    i made some comparsion cycles thin film shader vs reference paper renders.

    here the source from the papers.
    https://belcour.github.io/blog/resea...thin-film.html

    the screen shot ,from the paper there i done the comparsion renders.

    Attachment 502068

    and here the comparsion result, with the same settings ,in Blender with the thin film shader.

    Attachment 502069

    these are pngs,here a quick preview
    Click image for larger version. 

Name:	paperpreview1 Kopie.jpg 
Views:	6 
Size:	449.9 KB 
ID:	502132
    Click image for larger version. 

Name:	thinball1.jpg 
Views:	17 
Size:	1.11 MB 
ID:	502070
    Last edited by pixelgrip; 18-Oct-17 at 09:55.



Page 14 of 14 FirstFirst ... 4121314

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •