Bugfix texture calculation with new all C++ code.