Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

Optimizations

Optimizations

noaktree
noaktree
noaktree leaves · · 1 min read
538 0
I optimized two functions in the core graphics class. These functions get either the nearest active light (NAL1) or the second nearest active light (NAL2) in relation to a vector parameter. The optimized part is that now each function stores the previous nearest light found and the previous vector parameter. Now each time one of the two functions are called they check to see if the vector parameter is the same as the previously stored vector and also if the lighting state has not changed. If both are true then the function skips all redundant calculations are returns the previously calculated nearest active light (NAL). This adjustment should make rendering position-static objects, which use material shaders that depend on engine lighting information, more efficient.

Next up: Modifying the SEND functions of the FX Shader class to allow dynamic naming of handles for engine specific data. This is necessary as it allows the shader author to name shader parameters anything ( and make multiple instances of objects) rather than needing to follow a strict set of parameter naming rules for engine specific data. Should be fun and it is a necessary step to implementing the new parameter semantics and annotation naming conventions mentioned on the 28th.

Discussion

Loading comments...