<!--quoteo(post=576905:date=Apr 8 2011, 04:13 PM:name=MarkTheEchidna)--><div class='quotetop'>QUOTE (MarkTheEchidna @ Apr 8 2011, 04:13 PM) <a href="index.php?act=findpost&pid=576905"></a></div><div class='quotemain'><!--quotec-->@DustArma: Whoah, that's quite severe. Hadn't seen the video. @Chimpo: That's most likely the game trying to invert a singular matrix. Sylvester (the math lib I used) returns null on errors like this, hence the error "Cannot call method 'transpose' of null". The singular matrix was generated likely due to numeric instability inside Sylvester itself. I'll add a sanity check to make sure this doesn't happen again. @Gen Wait, so specular and albedo are vec3? I thought they were float, and had r,g,b components stored along with them. Makes much more sense now.<!--QuoteEnd--></div><!--QuoteEEnd--> Our light buffer consists of this: RGB: Light A: Specular highlight Storing our specular highlight in our alpha channel makes sense, since in a traditional forward renderer, the specular highlight would be a float multiplied against a specular map at a later stage anyways. So we basically just multiply the light (RGB) against the albedo (which we'll assume is vec3), and the specular highlight (A) against our specular map (which can either be float or vec3, depending on if you want to use an extra texture or the alpha of an existing texture), then add the two resulting specular and diffuse components together. Another nifty trick you could do, since we're storing our specular exponent for the deferred renderer in its own channel, then later multiplying by 128 within the fragment shader, you could actually use the alpha of your specular map to influence the specular highlight's exponent; therefore giving you a specular exponent map.