Home Unreal Engine

Cook-Torrance

polycounter lvl 10
Offline / Send Message
tuxmask75 polycounter lvl 10
Wondering if anyone has any good UDK Cook-Torrance shaders or examples on hand.
Badly in need of one for my project!

Replies

  • TheMetaMorphe
    Options
    Offline / Send Message
    TheMetaMorphe polycounter lvl 12
    Hey,

    Here you'ill find what you asked for : https://dl.dropbox.com/u/1812933/UDK/CG_CookTorrance.upk

    It's full HLSL, I didn't make it for being used in game. But it will be straightforward to convert it to node.

    Code belongs to : http://content.gpwiki.org/index.php/D3DBook:%28Lighting%29_Cook-Torrance
  • tuxmask75
    Options
    Offline / Send Message
    tuxmask75 polycounter lvl 10
    Hey,

    Here you'ill find what you asked for : https://dl.dropbox.com/u/1812933/UDK/CG_CookTorrance.upk

    It's full HLSL, I didn't make it for being used in game. But it will be straightforward to convert it to node.

    Code belongs to : http://content.gpwiki.org/index.php/D3DBook:%28Lighting%29_Cook-Torrance

    Thanks this really helps! I'll try my best to translate these to nods, but I'm kind of new at doing that, may take some time.
    also
    Which part is the reflectance at normal incidence?
  • TheMetaMorphe
    Options
    Offline / Send Message
    TheMetaMorphe polycounter lvl 12
    It's the Fresnel term. With a default value of 0.028000 for reflectance.
  • tuxmask75
    Options
    Offline / Send Message
    tuxmask75 polycounter lvl 10
    Thanks man !
    I'll have to upload some screens when I'm done with some more modeling,
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    It shouldn't be too hard to recreate it all in nodes, but I really doubt you need to, just checked Metal's material against mine, and the difference is that of 2-5 instructions more.

    Why do you need it? Is there a specific reason? Can't you recreate a cheaper version of Cook-Torrance by simply Mutiplying your Shlick by the final outcome from your Blinn, with a really high constant value? It will be about 20 instructions cheaper.

    I also took a look between the difference of Beckmann and Gaussian builds, both against a Blinn setup mentioned above, I still cannot see the 'difference' this offers when compared to Blinn.
  • TheMetaMorphe
    Options
    Offline / Send Message
    TheMetaMorphe polycounter lvl 12
    Beckmann and Gaussian don't have the same curve distribution. Gaussian appears to be constant but to be confirmed. And Beckmann is the most physical model.

    Update : https://dl.dropbox.com/u/1812933/UDK/CG_CookTorrance.upk ( I've normlized the L, V and N vector )
  • tuxmask75
    Options
    Offline / Send Message
    tuxmask75 polycounter lvl 10
    Beckmann and Gaussian don't have the same curve distribution. Gaussian appears to be constant but to be confirmed. And Beckmann is the most physical model.

    Update : https://dl.dropbox.com/u/1812933/UDK/CG_CookTorrance.upk ( I've normalized the L, V and N vector )

    HM, actually i cant see any difference , what does the normalizing do ?
    Maybe because i have a constant 3 with 1 in blue instead of a normal map?

    Ace-Angel wrote: »
    Why do you need it? Is there a specific reason? Can't you recreate a cheaper version of Cook-Torrance by simply Mutiplying your Shlick by the final outcome from your Blinn, with a really high constant value? It will be about 20 instructions cheaper.


    Will be using it for the hobby game I'm working on,
    Many of the level assets are metallic.
    I'm mainly looking for all kinds of Lighting model shaders to bring a little more realism to my project. I haven't the advanced shader skills to convert HLSL to nods.

    Another shader id really like to use is that SSS transmission shader shown in EA's dice video for the crystal cave level that is planed.

    As for the game I'm working on, Its going to be a HD 2.5D remake of Sonic CD.
    The video below shows Sonic 1's Green hill zone in 3D with Retro styled graphics.
    this was done for proof of concept to set up the physics and game-play systems.
    And to make sure that the game was as close to the original as it could be.

    When watching the video it may be hard to notice , but everything is a custom 3D model, and texture,
    Yes even the grass ,water, trees and there leaves are all 3D .
    (to give a parallax and depth effect)
    (the sign at the end used multiple 3D models that change in and out to produce the animations in much the same way as sprites do)
    [ame="http://www.youtube.com/watch?v=tR2sLAXzF84"]GHZ 2.5 Beta Build 11 Speedrun - YouTube[/ame]

    Now that the game-play proof of concept stuff is out of the way. Its time to scrap the retro pixelated look and feel, and continue with the original Idea that was started.
    I'm really wanting to add as much realism as I can, all while keeping the surreal look of the Sonic world intact. Textures and simple shaders can only go so far in that regard.
    I feel lighting shader models may be one of the key elements that will really make this project shine visually!


    Here are a few asset renders from back in 2006,
    Yeah i know the screens are kind of old and dated. thats because this projects been on hold for sometime now so that i could work on another project.
    (Well,,, some work has been done here and there threwout the years)
    There will be a hell of a lot of updating to do for these models, and textures for realtime use, as hardware has improved quite a bit since 2006.

    If anyone would like to help out with some more lighting model shaders,
    it would be very much appreciated!
    finished7my.jpg
    shuterssonic.jpg
  • tuxmask75
    Options
    Offline / Send Message
    tuxmask75 polycounter lvl 10
    Also is it possible to make the spec and diffuse color contrast offset more like seen in this video ? (Brighter specular without washing out the diffuse so much)
    cant seem to pull it off with the current settings.
    [ame="http://www.youtube.com/watch?v=zM9TUrgVhQU"]Cook-Torrance Shading - YouTube[/ame]


    The best i could come up with for brightening the shader's spec up was this
    Cant really seem to tighten up the specular's spread visually.
    teaa.png

    My settings are:
    5 Specular
    0.028 Fresnel
    1.0 roughness value
    and the world light is a movable point light with value of 2 for brightness.
Sign In or Register to comment.