Rastar Posted January 23, 2014 Share Posted January 23, 2014 I am used to a calculation of specular reflection along the lines of pow( saturate( NdotH ), specularHardness ) maybe multiplied by an additional factor. Yet, when I look into the provided shaders, I see nothing of the sort, just a multiplication of specular texture times specular color, and then some sort of packing this into frag1.a Where is my usual specular reflection? Quote Link to comment Share on other sites More sharing options...
shadmar Posted January 23, 2014 Share Posted January 23, 2014 For specular using normals just color: fragData1.a = materialcolorspecular; for using specularmap : (standard luminance used by the television industry, rgb=0.299,0.587,0.114) (says google) color_specular = texture(texture2,ex_texcoords0) * materialcolorspecular; .. fragData1.a = color_specular.r * 0.299 + color_specular.g * 0.587 + color_specular.b * 0.114; Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
shadmar Posted January 23, 2014 Share Posted January 23, 2014 In deferred shading all lighting is done in a prepass. So you don't have the same control you do in forward rendering. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Rastar Posted January 23, 2014 Author Share Posted January 23, 2014 I was hoping you would jump in... Oh, OK, so this means I can only control the relative contributions of the three color channels to a materials specularity, but cannot really control e.g. the size of the specular dot (meaning: if the material is shiny or matte)? Quote Link to comment Share on other sites More sharing options...
shadmar Posted January 23, 2014 Share Posted January 23, 2014 Yes you can, look in the pointlight.shader specular = lightspecular * specularity * pow(clamp(-dot(lightreflection,screennormal),0.0,1.0),GLOSS); GLOSS would control this. It's default 10.0, you could simply just send that through an uniform if you change the lighting shaders. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Rastar Posted January 23, 2014 Author Share Posted January 23, 2014 Ah, but that is my NdotH formula from above, isn't it? Great, thanks! Quote Link to comment Share on other sites More sharing options...
shadmar Posted January 23, 2014 Share Posted January 23, 2014 Yes. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Josh Posted January 23, 2014 Share Posted January 23, 2014 Although we don't have room for a per-material gloss value, one thing I have considered it packing a few extra flags into the material flags value. We could have two flags that would control four possible gloss values; low, medium, high, very high, or something like that. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.