New fresnel textures

Discussion related to the implementation of new features & algorithms to the Core Engine.

Moderators: jromang, tomb, zcott, coordinators

New fresnel textures

Postby jeanphi » Thu Sep 08, 2011 3:06 pm

Hi,

I've just added fresnel versions of the band, bilerp, mix and multimix textures. Those are hardly physical but should enable some interesting creative usage.

Jeanphi
jeanphi
Developer
 
Posts: 6577
Joined: Mon Jan 14, 2008 7:21 am

Re: New fresnel textures

Postby pciccone » Thu Sep 08, 2011 4:19 pm

Hi Jeanphi. Thank you for thins new addition. Would it be possible to see some examples of usage?

Thanks in advance.
User avatar
pciccone
Developer
 
Posts: 686
Joined: Wed Jan 13, 2010 11:02 am
Location: California

Re: New fresnel textures

Postby jeanphi » Thu Sep 08, 2011 4:51 pm

Hi,

Do you mean renders or syntax?

Jeanphi
jeanphi
Developer
 
Posts: 6577
Joined: Mon Jan 14, 2008 7:21 am

Re: New fresnel textures

Postby pciccone » Thu Sep 08, 2011 5:02 pm

Both :)
But syntax is the most needed. Thanks!
User avatar
pciccone
Developer
 
Posts: 686
Joined: Wed Jan 13, 2010 11:02 am
Location: California

Re: New fresnel textures

Postby jeanphi » Thu Sep 08, 2011 5:50 pm

Hi,

The syntax is the same as for the float and color versions:
Code: Select all
#You can have as many offsets as you want in the band texture
Texture "myband" "fresnel" "band" "float offsets" [0.1 0.5 0.8] "texture amount" ["myamount"] "texture tex1" ["fresnel01"] "texture tex2" ["fresnel05"] "texture tex3" ["fresnel08"]
#The bilerp texture accepts a "string mapping" parameter with values "uv", "spherical", "cylindrical" and "planar", each one having subsequent tuning knobs
Texture "mybilerp" "fresnel" "bilerp" "texture v00" ["fresnel00"] "texture v01" ["fresnel01"] "texture v10" ["fresnel10"] "texture v11" ["fresnel11"]
Texture "mymix" "fresnel" "mix" "texture amount" ["myamount"] "texture tex1" ["fresnel0"] "texture tex2" ["fresnel1"]
Texture "mymulti" "fresnel" "multimix" "float weights" [0.1 0.5 0.4] "texture tex1" ["fresnel1"] "texture tex2" ["fresnel2"] "texture tex3" ["fresnel3"]


band is like a mix with more intervals, multimix is a freeform mix with constant weights (the weights are not normalized to 1 and you can have as many as you want), bilerp is a bilinear interpolation between all 4 textures using the specified coordinates.

Jeanphi
jeanphi
Developer
 
Posts: 6577
Joined: Mon Jan 14, 2008 7:21 am

Re: New fresnel textures

Postby J the Ninja » Thu Sep 08, 2011 7:01 pm

At the least they'll allow the fake-birefringence trick with glass2. :)

Btw, piciccone, multi-mix is easier to understand if you think of it as an "add" or "stack" node. Basically, each input is multiplied by its weight, and then they're all summed.
-Jason

Material DB Admin
User avatar
J the Ninja
Developer
 
Posts: 2210
Joined: Wed May 19, 2010 9:54 pm
Location: Portland, USA

Re: New fresnel textures

Postby J the Ninja » Thu Sep 08, 2011 7:58 pm

Jeanphi, something seems wrong with the fresnel band. Bilerp works fine, but this gives "[Lux 2011-Sep-08 17:53:27 ERROR : 14] Static loading of fresnel texture 'band' failed."

Code: Select all
# Materials File

Texture "Tex" "fresnel" "band"
   "float amount" [0.186000004410744]
   "float tex1" [1.560321807861328]
   "float tex2" [20.000000000000000]
   "float offsets" [0.000000000000000 1.000000000000000]

MakeNamedVolume "glass" "clear"
   "texture fresnel" ["Tex"]
   "color absorption" [0.00000000 0.00000000 0.00000000]

MakeNamedMaterial "Material"
   "bool architectural" ["false"]
   "bool dispersion" ["false"]
   "string type" ["glass2"]

-Jason

Material DB Admin
User avatar
J the Ninja
Developer
 
Posts: 2210
Joined: Wed May 19, 2010 9:54 pm
Location: Portland, USA

Re: New fresnel textures

Postby neo2068 » Fri Sep 09, 2011 12:13 am

J the Ninja wrote:Jeanphi, something seems wrong with the fresnel band. Bilerp works fine, but this gives "[Lux 2011-Sep-08 17:53:27 ERROR : 14] Static loading of fresnel texture 'band' failed."

Code: Select all
# Materials File

Texture "Tex" "fresnel" "band"
   "float amount" [0.186000004410744]
   "float tex1" [1.560321807861328]
   "float tex2" [20.000000000000000]
   "float offsets" [0.000000000000000 1.000000000000000]

MakeNamedVolume "glass" "clear"
   "texture fresnel" ["Tex"]
   "color absorption" [0.00000000 0.00000000 0.00000000]

MakeNamedMaterial "Material"
   "bool architectural" ["false"]
   "bool dispersion" ["false"]
   "string type" ["glass2"]



There was a typo in band.cpp. Should be fixed now.
i7 860, 16 GB RAM, NVIDIA Geforce GTX 560 + GTX 460, Windows 7 64bit, Blender 2.66
neo2068
Developer
 
Posts: 485
Joined: Sun May 03, 2009 2:11 am
Location: Germany

Re: New fresnel textures

Postby J the Ninja » Fri Sep 09, 2011 1:50 am

neo2068 wrote:
J the Ninja wrote:Jeanphi, something seems wrong with the fresnel band. Bilerp works fine, but this gives "[Lux 2011-Sep-08 17:53:27 ERROR : 14] Static loading of fresnel texture 'band' failed."

Code: Select all
# Materials File

Texture "Tex" "fresnel" "band"
   "float amount" [0.186000004410744]
   "float tex1" [1.560321807861328]
   "float tex2" [20.000000000000000]
   "float offsets" [0.000000000000000 1.000000000000000]

MakeNamedVolume "glass" "clear"
   "texture fresnel" ["Tex"]
   "color absorption" [0.00000000 0.00000000 0.00000000]

MakeNamedMaterial "Material"
   "bool architectural" ["false"]
   "bool dispersion" ["false"]
   "string type" ["glass2"]



There was a typo in band.cpp. Should be fixed now.


yep, seems ok now
-Jason

Material DB Admin
User avatar
J the Ninja
Developer
 
Posts: 2210
Joined: Wed May 19, 2010 9:54 pm
Location: Portland, USA

Re: New fresnel textures

Postby jeanphi » Fri Sep 09, 2011 2:16 am

J the Ninja wrote:At the least they'll allow the fake-birefringence trick with glass2. :)

No, it won't. It will at most fake mixing liquids with different IOR. Birefringence is an entirely different story, it needs support at the material level.
And thanks neo2068 for fixing my silly typo.

Jeanphi
jeanphi
Developer
 
Posts: 6577
Joined: Mon Jan 14, 2008 7:21 am

Next

Return to Architecture & Design

Who is online

Users browsing this forum: No registered users and 0 guests