Shader Writing Question(s)

Discussion in 'Modding' started by blakboks, Nov 6, 2013.

  1. blakboks

    blakboks Registered

    Joined:
    Oct 20, 2010
    Messages:
    843
    Likes Received:
    30
    So, I'm trying to do some shader writing. I'll qualify my question(s) by saying that I've written some shaders for Unity and for use in Softimage, and I'm (currently) working my way through "Introduction to 3D Game Programming with DirectX11" by Frank Luna, but this is my first time venturing into actually writing a shader for rF2/3DSMax. So, I'm kind of a newb, but I'm not 100% clueless, and I've done/am doing quite a bit on my own to find out as much as I can; hopefully, all I'm asking is stuff that's specific to how rF2 works.

    Anyway, the question:
    How can I get a material constant into the shader? i.e. using a color picker in 3DSMax or a spinner (i.e. for a float value), similar to Ambient/Diffuse/Emissive/Specular colors and Material Alpha, Specular Power, etc. This was fairly trivial when writing shaders in Unity and Softimage, but I'm not sure of syntax and/or whatnot for 3DSMax/rF2.

    I'm guessing it's somewhere in the .GFX? I see "ShaderConstants=(Default, BumpMap, OmniLight)" (for the Vertex Shader) but I'm not seeing references to these keywords in any of the provided docs so far (i.e. ShaderStubs.h, PShaderStubs.h, or in the provided Vertex Shader or Pixel Shader directly). So, I'm not sure if I define my own constants in this field as well, and if so, how I should get those values in the shaders.

    I'd like to avoid using a texture as it seems entirely unnecessary, and impractical for many things (i.e. defining a depth scalar on a Parallax Occlusion Map shader--which would be a single float value outside of 0-1).

    I hope someone can be of some help, and thanks in advance to whomever can :D
     

Share This Page