Author Topic: Linear Falloff Map  (Read 9119 times)

2015-04-21, 02:58:45

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
I have recreated the linear falloff map that Viscorbel is talking about HERE
Viscorbel has uploaded two OSL shaders that people can use in V-ray to correct the maps, but as far as I know, we can't use OSL in Corona.

I have uploaded a max 2013 scene with the custom falloff map and a Material Library.

Would be awesome if Corona got some kind of OSL support.

This is the OSL code that make linear falloff. Made by Wobi.
Code: [Select]
shader facing_ratio_linear (output color Col_Out = color(0.5))
{
float floatOut = acos (1.0 - (1 - (dot(normalize(N), normalize(I))* -1)))/(M_PI * 0.5);
    Col_Out = color(floatOut  , floatOut , floatOut );
}

Since we can't use the OSL, you have to plug the fixed falloff map into an Output map to adjust it.


Look into his eyes !


Enjoy.
« Last Edit: 2015-04-23, 18:54:30 by dubcat »
             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)

2015-04-21, 10:26:55
Reply #1

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 5981
  • Let's move this topic, shall we?
    • View Profile
    • My Models
In Mental Ray one just simply plugs fallof through gamma & gain map and that's it. CoronaColor map has ability to input colors in linear or sRGB space, but unfortunatelly there's no way to plug a map in it. Maybe it's time for yet another request?

And support for OSL shaders would be great too.
I'm not Corona Team member. Everything i say, is my personal opinion only.

2015-04-21, 12:26:22
Reply #2

Ludvik Koutny

  • VIP
  • Active Users
  • ***
  • Posts: 2562
  • Just another user
    • View Profile
    • My Portfolio
Actually, 3ds Max falloff node set to linear truly is linear, but the problem is that 3ds Max gamma correction (LWF) gamma corrects also procedural textures (as Romullus pointed out), which is often undesired. You can fix that by feeding your falloff through color correction node with Gamma set to 2.2, as on the picture below.


2015-04-21, 12:41:09
Reply #3

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
They tried the gamma fix before they made the OSL shader. But the result is not 100% correct. They said the falloff map is using "cosine of the angle" and not the "actual angle". So they are inverting the cos with arccos.

             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)

2015-04-21, 14:47:48
Reply #4

Ludvik Koutny

  • VIP
  • Active Users
  • ***
  • Posts: 2562
  • Just another user
    • View Profile
    • My Portfolio

2015-04-21, 20:08:18
Reply #5

Juraj Talcik

  • Active Users
  • **
  • Posts: 3699
  • Tinkering away
    • View Profile
    • studio website
Interesting, so the outcome is Viscorbel was correct ?

SigerShaders might be interested in this :- )

Edit,ah found it:

Quote
The Falloff map works with the cosine of the angle, and not with the actual angle. The curve that viscorbel shows above is the graph of its inverse (the arccos function).

Best regards,
Vlado

And this :- D

Quote
I've reported this to heading of rendering engineering at Autodesk and it surprised him as well.
Dave Worthley
« Last Edit: 2015-04-21, 20:14:43 by Juraj_Talcik »
talcikdemovicova.com  Website and blog
be.net/jurajtalcik   Our studio Behance portfolio
Instagram   Our studio Instagram, managed by Veronika

2015-04-22, 01:21:08
Reply #6

fco3d

  • Active Users
  • **
  • Posts: 55
    • View Profile
If I understand correct you fixed falloff, will only apply to one type of material only? one type of metal.
By CorBel shader you can change the curve depending of N and K values.

how did you get that curve any ways? I am trying to copy but it does not give me any values, just the curve.

2015-04-22, 15:25:23
Reply #7

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
If I understand correct you fixed falloff, will only apply to one type of material only? one type of metal.
By CorBel shader you can change the curve depending of N and K values.

how did you get that curve any ways? I am trying to copy but it does not give me any values, just the curve.

It's just a linear falloff map, so you can use it for whatever you want. The curve I have recreated is the inverse of the curve that is messing up the original falloff map. (The one I have uploaded here is still 1-2 pixel off the perfect OSL shader. Going to tweak it later today, can re-upload)
Just plug it into an Output map and adjust the curve as you usually would do.

I posted this test over at the original thread. As you can see, no normal person would see the difference. It's all about the geek inside, that knows you have been using a wrong falloff map your whole life!
« Last Edit: 2015-04-23, 04:04:11 by dubcat »
             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)

2015-04-23, 00:26:10
Reply #8

fco3d

  • Active Users
  • **
  • Posts: 55
    • View Profile
Ok thanks for the answer.
I was wondering what values did you used to create that falloff, because. When I opened your file 3d Max warn me that it was created using a educational version of 3D Max, after using that falloff in a new scene, in my machine still telling me that it was created in student version :(

I won't be able to use that falloff here, if you could share the actual values ( don't know how) it would be great.
Thank you again.

2015-04-23, 01:51:47
Reply #9

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
Here's the new tweaked falloff.


I have uploaded a Material Library for you, just download that one.

EDIT:
The Material Library was empty, fixed in the new upload
« Last Edit: 2015-04-23, 18:57:33 by dubcat »
             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)

2015-04-26, 01:13:12
Reply #10

Siger

  • Active Users
  • **
  • Posts: 140
    • View Profile
Now I'm in progress on free Texmap plugin based on Vlado OSL code: http://forums.chaosgroup.com/showthread.php?81605-Complex-fresnel-using-VRayOSLtex&p=651334#post651334
Test on Corona - OK :) Now adding presets.

2015-04-26, 06:23:54
Reply #11

dubcat

  • Active Users
  • **
  • Posts: 460
  • ฅ^•ﻌ•^ฅ meow
    • View Profile
Now I'm in progress on free Texmap plugin based on Vlado OSL code: http://forums.chaosgroup.com/showthread.php?81605-Complex-fresnel-using-VRayOSLtex&p=651334#post651334
Test on Corona - OK :) Now adding presets.
Great work as always :)
             ___
    _] [__|OO|
   (____|___|     https://www.twitch.tv/dubca7 / https://soundcloud.com/dubca7 ( ͡° ͜ʖ ͡°)

2015-04-26, 09:34:30
Reply #12

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 5981
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Now I'm in progress on free Texmap plugin based on Vlado OSL code: http://forums.chaosgroup.com/showthread.php?81605-Complex-fresnel-using-VRayOSLtex&p=651334#post651334
Test on Corona - OK :) Now adding presets.

Wow, looking forward to it!
I'm not Corona Team member. Everything i say, is my personal opinion only.

2015-04-27, 17:45:43
Reply #13

steyin

  • Active Users
  • **
  • Posts: 346
  • BALLS
    • View Profile
    • Instagram Page
Sorry to be OT, but is there anyway to change the threads on the vray forum to descending? I hate reading newest posts from the bottom to the top. All I can find is the linear option, which doesn't allow to edit ascending->descending.

That aside, this looks very promising. Already downloaded the beta, will give it a whirl later.

2015-05-01, 20:00:53
Reply #14

danielmn

  • Active Users
  • **
  • Posts: 70
    • View Profile
I could get the Linear falloff shader to work, so I moved on to what viscorbel talked about, that glossy reflection have a sharpness as they approach the 90 degree of incidence.

Here is a test I did with Siger's Complex Fresnel Shader.  Thanks to the guys at Siger btw.

Daniel M. Najera
3D Enviroment Artist
danielmn81@gmail.com
https://www.facebook.com/daniel.m.najera1