What's the proper of way of calculating the coords to apply decals by let's say linear interpolation? My understanding is that you render your GBuffer albedo, specular, etc... and after that you do another pass (before the lighting calculations) in which you modify the albedo and normal maps (and anything you'd like to get information from the decal). My guess is you transform your vertices to NDC to be able to calculate the bbox (for simplicity, I understand you can use more complex geometry) in which you want to apply the decals, use those bounds to discard every other fragment and write the decal to the maps. Is my understanding correct? And what matrix should be passed for calculating the depth? Should I do a previous pass to get the depth? Can I use the depth from a point different than the camera (I am calculating shadow maps already so being able to skip this step would be awesome), or can I reuse the one that I feed my lighting pass with?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.