Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualbelfegor

Posted 23 July 2013 - 12:04 PM

Here is the hlsl output for 3ds max default standard material:

material-editor-01-defau.jpg

struct PixelInput {
    float4 norm        : TEXCOORD0;
    float4 worldpos    : TEXCOORD1;
    float4 eyevector    : TEXCOORD2;
    float4 tangent        : TEXCOORD3;
    float4 binormal    : TEXCOORD4;
    float4 objpos        : TEXCOORD5;
    float4 tex0        : TEXCOORD6;
    float4 tex1        : TEXCOORD7;
};


struct PixelOutput {
    float4 c         : COLOR;
};


uniform float4 Diffuse = float4(0,588235,0,588235,0,588235,1,000000);
uniform float4 Specular = float4(0,900000,0,900000,0,900000,1,000000);
uniform float4 Emissive = float4(0,000000,0,000000,0,000000,1.0f);
uniform float SpecularLevel = 1,000000;
uniform float GlossLevel = 9,999999;
uniform float3 LightCol0;
uniform float3 LightDir0;
uniform float LightFallOff0;
uniform float LightHotSpot0;
uniform float Opacity = 1,000000;

PixelOutput fragmentEntry(PixelInput pi)
{
    PixelOutput PO;
    float3 N;
    N = normalize(pi.norm.xyz);
    float3 Eye;
    Eye.xyz = normalize(pi.eyevector.xyz);
    float4 nColor = float4(0.0,0.0,0.0,1.0);
    float4 mDiffuse = Diffuse;
    float4 mSpecular = Specular;
    float4 SelfIllum = Emissive;
    nColor = nColor + SelfIllum * mDiffuse;
    float3  H;
    float3 Light;
    float f;
    float fAtt;
    float fDist;
/*  default light */
    fAtt = 1.0;
    nColor = nColor + float4(LightCol0,1.0) * mDiffuse * clamp(dot(N,LightDir0),0,1) * fAtt;
    H = normalize(Eye+Light);
    f = clamp(dot(N,H),0,1);
    f = pow(f, GlossLevel);
    f = f * SpecularLevel;
    nColor = nColor + float4(LightCol0,1.0) * mSpecular * f * fAtt;
/* end of default light */
    nColor.a = Opacity;
    PO.c = nColor;
    return PO;
}


Looks like they use Glossiness as "materialPower/Shinniness" and "Specular level" is just scalar for specular power (i would set it to 100 (1.0) to match your shader).


#2belfegor

Posted 23 July 2013 - 12:00 PM

Here is the hlsl output for 3ds max default standard material:

material-editor-01-defau.jpg

struct PixelInput {
    float4 norm        : TEXCOORD0;
    float4 worldpos    : TEXCOORD1;
    float4 eyevector    : TEXCOORD2;
    float4 tangent        : TEXCOORD3;
    float4 binormal    : TEXCOORD4;
    float4 objpos        : TEXCOORD5;
    float4 tex0        : TEXCOORD6;
    float4 tex1        : TEXCOORD7;
};


struct PixelOutput {
    float4 c         : COLOR;
};


uniform float4 Diffuse = float4(0,588235,0,588235,0,588235,1,000000);
uniform float4 Specular = float4(0,900000,0,900000,0,900000,1,000000);
uniform float4 Emissive = float4(0,000000,0,000000,0,000000,1.0f);
uniform float SpecularLevel = 0,960000;
uniform float GlossLevel = 100,000000;
uniform float3 LightCol0;
uniform float3 LightDir0;
uniform float LightFallOff0;
uniform float LightHotSpot0;
uniform float Opacity = 1,000000;

PixelOutput fragmentEntry(PixelInput pi)
{
    PixelOutput PO;
    float3 N;
    N = normalize(pi.norm.xyz);
    float3 Eye;
    Eye.xyz = normalize(pi.eyevector.xyz);
    float4 nColor = float4(0.0,0.0,0.0,1.0);
    float4 mDiffuse = Diffuse;
    float4 mSpecular = Specular;
    float4 SelfIllum = Emissive;
    nColor = nColor + SelfIllum * mDiffuse;
    float3  H;
    float3 Light;
    float f;
    float fAtt;
    float fDist;
/*  default light */
    fAtt = 1.0;
    nColor = nColor + float4(LightCol0,1.0) * mDiffuse * clamp(dot(N,LightDir0),0,1) * fAtt;
    H = normalize(Eye+Light);
    f = clamp(dot(N,H),0,1);
    f = pow(f, GlossLevel);
    f = f * SpecularLevel;
    nColor = nColor + float4(LightCol0,1.0) * mSpecular * f * fAtt;
/* end of default light */
    nColor.a = Opacity;
    PO.c = nColor;
    return PO;
}

Looks like they use Glossiness as "materialPower/Shinniness" and "Specular level" is just scalar for specular power (i would set it to 100 (1.0) to match your shader).


#1belfegor

Posted 23 July 2013 - 11:59 AM

Here is the hlsl output for 3ds max default standard material:

material-editor-01-defau.jpg

 

struct PixelInput {
    float4 norm        : TEXCOORD0;
    float4 worldpos    : TEXCOORD1;
    float4 eyevector    : TEXCOORD2;
    float4 tangent        : TEXCOORD3;
    float4 binormal    : TEXCOORD4;
    float4 objpos        : TEXCOORD5;
    float4 tex0        : TEXCOORD6;
    float4 tex1        : TEXCOORD7;
};


struct PixelOutput {
    float4 c         : COLOR;
};


uniform float4 Diffuse = float4(0,588235,0,588235,0,588235,1,000000);
uniform float4 Specular = float4(0,900000,0,900000,0,900000,1,000000);
uniform float4 Emissive = float4(0,000000,0,000000,0,000000,1.0f);
uniform float SpecularLevel = 0,960000;
uniform float GlossLevel = 100,000000;
uniform float3 LightCol0;
uniform float3 LightDir0;
uniform float LightFallOff0;
uniform float LightHotSpot0;
uniform float Opacity = 1,000000;

PixelOutput fragmentEntry(PixelInput pi)
{
    PixelOutput PO;
    float3 N;
    N = normalize(pi.norm.xyz);
    float3 Eye;
    Eye.xyz = normalize(pi.eyevector.xyz);
    float4 nColor = float4(0.0,0.0,0.0,1.0);
    float4 mDiffuse = Diffuse;
    float4 mSpecular = Specular;
    float4 SelfIllum = Emissive;
    nColor = nColor + SelfIllum * mDiffuse;
    float3  H;
    float3 Light;
    float f;
    float fAtt;
    float fDist;
/*  default light */
    fAtt = 1.0;
    nColor = nColor + float4(LightCol0,1.0) * mDiffuse * clamp(dot(N,LightDir0),0,1) * fAtt;
    H = normalize(Eye+Light);
    f = clamp(dot(N,H),0,1);
    f = pow(f, GlossLevel);
    f = f * SpecularLevel;
    nColor = nColor + float4(LightCol0,1.0) * mSpecular * f * fAtt;
/* end of default light */
    nColor.a = Opacity;
    PO.c = nColor;
    return PO;
}

 

Looks like they use Glossiness as "materialPower/Shinniness" and "Specular level" is just scalar for specular power.


PARTNERS