tag:blogger.com,1999:blog-398682525365778708.post723458188478959497..comments2023-07-06T02:40:05.577-07:00Comments on Diary of a Graphics Programmer: Light Pre-Pass - First Blood :-)Wolfgang Engelhttp://www.blogger.com/profile/11031097395025597662noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-398682525365778708.post-66697095569383160152008-08-25T09:49:00.000-07:002008-08-25T09:49:00.000-07:00One could argue that, but the position of the ligh...One could argue that, but the position of the light and the material have by far more of an impact on the shape of the specular highlight than the spectrum of the light does, so I think the criticism is still quite valid.<BR/><BR/>I believe this is also why the guys at Naughty Dog write out the specular power when they generate the geometry (position/normal) information. And it is also why they output two 3-component light values from their light shaders - a diffuse and a specular texture.<BR/><BR/>This still allows them the nice middle ground between a fully deferred renderer and a forward renderer.<BR/><BR/>PhilPhil Teschnerhttps://www.blogger.com/profile/07688687352136934369noreply@blogger.comtag:blogger.com,1999:blog-398682525365778708.post-33212720201984208582008-07-31T18:32:00.000-07:002008-07-31T18:32:00.000-07:00Oh I thought the ^n term is also called shininess ...Oh I thought the ^n term is also called shininess value .. so ok let's just talk about the exponential operation you mention. <BR/><BR/>You could argue that the way it is handled by most games is wrong. This exponential operation is a property of the light source and the material and not just a property of one of them.<BR/>Let me look at it in the game for a while ... I get back to you regarding this.Wolfgang Engelhttps://www.blogger.com/profile/11031097395025597662noreply@blogger.comtag:blogger.com,1999:blog-398682525365778708.post-66964271611344444002008-07-31T18:16:00.000-07:002008-07-31T18:16:00.000-07:00Light sources have shininess values? I have never ...Light sources have shininess values? I have never seen that before.<BR/><BR/>My point was that exponential operation is not distributive over addition. (a+b)^n != (a^n + b^n)Unknownhttps://www.blogger.com/profile/18111213145214467262noreply@blogger.comtag:blogger.com,1999:blog-398682525365778708.post-1117292428944744872008-07-31T15:15:00.000-07:002008-07-31T15:15:00.000-07:00Let me experiment a bit more with what I have and ...Let me experiment a bit more with what I have and I give you feedback how well it works out. In case this is not working out I can always claim that I made a mistake and go back and put the specular power value in the normal map render target :-)Wolfgang Engelhttps://www.blogger.com/profile/11031097395025597662noreply@blogger.comtag:blogger.com,1999:blog-398682525365778708.post-72992518831773532932008-07-31T14:45:00.000-07:002008-07-31T14:45:00.000-07:00Hi Damian,there are two different shininess values...Hi Damian,<BR/>there are two different shininess values. One shinines value describes the light source shininess and the other the material shininess. A material reflects each light source with the same shininess value because its reflection properties are always the same. This is different from the shininess of each light source that is different per light.<BR/><<<<BR/>The only way I can think of having a per surface shininess value is to perhaps output it into the alpha of the normal in the pre-pass.<BR/><<< <BR/>This would be a serious restriction ... one of the main disadvantages of a deferred renderer.Wolfgang Engelhttps://www.blogger.com/profile/11031097395025597662noreply@blogger.comtag:blogger.com,1999:blog-398682525365778708.post-63805715700843263752008-07-31T02:31:00.000-07:002008-07-31T02:31:00.000-07:00I did mention this in the original post - but I st...I did mention this in the original post - but I still don't understand how this handles overlapping lights.<BR/><BR/>eg. <BR/>If k = (N.H^n * N.L * Att) from one light<BR/><BR/>one light on a pixel:<BR/><BR/>k1^mn - hacky but OK<BR/><BR/>two lights on a pixel:<BR/>(k1 + k2)^mn != k1^mn + k2^mn<BR/><BR/>three lights on a pixel:<BR/>(k1 + k2 + k3)^mn != k1^mn + k2^mn + k3^mn<BR/><BR/>Of course it may look OK in practice, but without seeing it I have my doubts. (Light overlap areas may look weird?)<BR/><BR/>The only way I can think of having a per surface shininess value is to perhaps output it into the alpha of the normal in the pre-pass.Unknownhttps://www.blogger.com/profile/18111213145214467262noreply@blogger.com