]> git.mxchange.org Git - simgear.git/commit
Manuel Massing:
authorcurt <curt>
Sun, 9 Nov 2008 15:39:54 +0000 (15:39 +0000)
committercurt <curt>
Sun, 9 Nov 2008 15:39:54 +0000 (15:39 +0000)
commite6371cbf9c399a1505b13c2d073c81e331b35c77
treefc4aea60a1eb836209e91e47a47e288fbf945ac1
parent0b8b6ac56ab1efd3ad8cd1f430ec48641a1f2a13
Manuel Massing:

Attached is a small fix for the sorting in CloudShaderGeometry.cxx.
I think the sorting problem stems from the osg idiosyncracy
to store transposed matrices...so the intuitive

       osg::Vec4f p = vm * osg::Vec4f(_cloudsprites[i]->position.osg(), 1.0f);

needs to be replaced with...

       osg::Vec4f p = vm.preMult(osg::Vec4f(_cloudsprites[i]->position.osg(), 1.0f);

The patch also optimizes the distance calculation - it evaluates the distances
in model space instead of eye space, which reduces computation to a dot-
product instead of a matrix multiplication.
simgear/scene/sky/CloudShaderGeometry.cxx