Home Technical Talk

TGA Physically Based Lighting CGFX Shader for Maya Viewport

13

Replies

  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Np,I am a little confused about roughness.Isn't that the same as a bump,normal or displacement map?
    If u paint a roughness map in black and white say showing the details of a brick wall,should it be just noise in black and white,then the normal map should be clean or the roughness map can have the details of the bricks as well as the noise details on the bricks?
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 18
    The roughness is exactly what it sounds like, how rough the surface is. White = super smooth, Black = very rough. What it results in is how narrow/wide the specular highlights and how sharp/blurry the reflections will turn out. Don't be afraid to actually use your hand and feel materials/surfaces :)

    If you have a brick you'd probably want it to be noisy in the scale between near black/mid grey. But you'd have to test it out. My best advice is to spend some time observing and doing your research for the material you're doing. You want bricks? Go look at bricks, take photos. Google image search, Flickr, etc. Then start tweaking the texture levels until you get it right. The normal map should still have the noisy details as well.
  • leleuxart
    Options
    Offline / Send Message
    leleuxart polycounter lvl 10
    melviso wrote: »
    Np,I am a little confused about roughness.Isn't that the same as a bump,normal or displacement map?
    If u paint a roughness map in black and white say showing the details of a brick wall,should it be just noise in black and white,then the normal map should be clean or the roughness map can have the details of the bricks as well as the noise details on the bricks?

    To add on to what Kodde said, have you use CryEngine or Marmoset? PBR renderers work similarly to their specular system. With both programs, the Gloss map affects the specular falloff(like spec power in UDK), but they also automatically introduce reflections. They do them a little differently, but both programs will increase the strength of a cubemap/screen-space reflections. I think understanding how a Gloss map works(EarthQuake wrote a really good tutorial on Marmoset's site for materials) would help, but keep in mind it'll be a little different for PBR.
  • EarthQuake
    Options
    Offline / Send Message
    kodde wrote: »
    The roughness is exactly what it sounds like, how rough the surface is. White = super smooth, Black = very rough. What it results in is how narrow/wide the specular highlights and how sharp/blurry the reflections will turn out. Don't be afraid to actually use your hand and feel materials/surfaces :)

    If you have a brick you'd probably want it to be noisy in the scale between near black/mid grey. But you'd have to test it out. My best advice is to spend some time observing and doing your research for the material you're doing. You want bricks? Go look at bricks, take photos. Google image search, Flickr, etc. Then start tweaking the texture levels until you get it right. The normal map should still have the noisy details as well.

    The roughness map is pretty much a gloss map right? Or is there some more technical stuff going on there that I'm missing?
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 18
    EarthQuake> Nope, pretty much a gloss map afaik.
    The substance map controls the specular color and fresnel term. This should be sampled from IOR based values if you're aiming at realism.
  • EarthQuake
    Options
    Offline / Send Message
    kodde wrote: »
    EarthQuake> Nope, pretty much a gloss map afaik.
    The substance map controls the specular color and fresnel term. This should be sampled from IOR based values if you're aiming at realism.

    Ok cool that's what I thought, and the substance map is similar to a specular map right? Where value controls specular reflection intensity and color controls, well color obviously?

    Is Fresnel tied to substance value, or can you control it independently through the alpha? Or a fixed shader value?
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 18
    As I've not written these exact inner algorithms in this shader I can't say for sure. But I'm not sure if the luminance of the substance texture actually alters the amount of specularity other than the color. The fresnel is derived from the luminance of the substance. Ie. brighter substance reflect in more angles, darker substance only reflect at glancing angles.
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 18
    In the May 25th post on this site my colleague whom I've authored this shader together with talks about physically based lighting. If you're interested in more detail have a look.

    http://www.defrostgames.com/2013/05/
  • xalener
    Options
    Offline / Send Message
    xalener polycounter lvl 5
    Man, this sucks. This is exactly what I've been looking for but I have the misfortune of having an ATI card.
  • throttlekitty
    Options
    Offline / Send Message
    kodde, you're SPEC-tacular, thanks again for this.
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 18
    xalener> I wish I had a solution for you :( I'm not certain that this is an issue with all ATI cards and CGFX shaders. None of my CGFX shaders work with ATI cards and I'm not sure why. I author my shaders in Mental Mill and do post tweaks in Notepad++. This issue probably some issue from the generated Mental Mill code, but I'm not sure where to start looking. Sorry. I get the feel that the general consensus if you ask people working with 3D is go for Nvidia for best compatibility.

    throttlekitty> Thanks :)
  • radiancef0rge
    Options
    Offline / Send Message
    radiancef0rge ngon master
    do you have the cg plugin enabled?
  • joeriv
    Options
    Offline / Send Message
    joeriv polycounter lvl 7
    yes, the shader doesn't work on ati cards :(
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 18
    New version out, 0.3.7

    From 0.3.6 to 0.3.7
    -Uses Schlick's approximation of the Schmidt shadowing function instead of Kelleman for the geometry term.
    -Max roughness 8192 -> 16384

    As always, you can get the shader here:
    http://www.kostas.se/?p=30
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    great job kodde, love your shaders.
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 18
    Cheers passerby.
    This last change has a quite noticeable effect on the specularity on rough areas at glancing angles. Was too much before, looks a whole lot better now.
  • [Deleted User]
    Options
    Offline / Send Message
    [Deleted User] insane polycounter
    The user and all related content has been deleted.
  • warby
    Options
    Offline / Send Message
    warby polycounter lvl 18
    I just wanted to take this opportunity to thank you kodde the shader rocks and so does the cubemap pack =)
  • CarlCraft
    Options
    Offline / Send Message
    CarlCraft polycounter lvl 9
    Hey Kodde, so glad I found this. Exactly what I am looking for.

    I can't get the shader to work however... I have SP 5 installed and DirectX11 set as rendering engine, but it can't run Viewport 2 (goes back to legacy as soon as I turn it on).

    Warning: Viewport 2.0 is not supported by your current graphics configuration or graphics driver version.
    The application is reverting to the legacy default viewport, please correct your graphics configuration or set the "Default viewport" preference to "Legacy Default Viewport" to prevent this error from recurring. //


    Here at work I have NVIDIA GeForce GTX 260 on my machine. Not really a top notch graphics card but is it true that it's simply too weak for this shader, or am I doing something wrong?

    Thanks
  • haiddasalami
    Options
    Offline / Send Message
    haiddasalami polycounter lvl 14
    Correct me if Im not msitaken but I dont think DX11 is supported by GTX 260.
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 18
    warby> Better late than never I suppose. Had missed your message. You are welcome :)

    callebo> Why not try the newer ShaderFX version instead? Also a PBL shader for Maya, fairly identical and uses the newer real-time shader system in Maya. Check it out and let me know how it goes. http://www.polycount.com/forum/showthread.php?p=2179773
  • CarlCraft
    Options
    Offline / Send Message
    CarlCraft polycounter lvl 9
    Oh shoot, I'm posting in the wrong thread

    I actually am trying to use the ShaderFX version. Although it doesn't really matter, since as soon as I open Maya (without loading the shader) I still can't render in viewport 2.0 which means it won't work, right?

    Maybe haidda is correct. Need to research this a bit more... Any other way of getting PBR to work in maya? Alternatively, any good tools for previewing it? Is marmoset the way to go?

    Edit: haidda is correct, directX 11 is not supported on GTX 260, however directX 10 is... Any way to load directX 10 as the rendering engine in Maya? Any plugin which isn't loaded that I'm missing?
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 18
    callebo> Oh I see... Well if you can't use the viewport 2.0 then I think you need to rethink your plan of any rather useful real-time shader in Maya's viewport. Maybe time for a new graphics card? The 260 GTX was released exactly [size=+1]7[/size] years ago on this date :P

    EDIT:
    From what I can tell the 260 GTX is only DX10 compatible.
13
Sign In or Register to comment.