Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12076


Ignore:
Timestamp:
Nov 7, 2018, 10:21:44 AM (3 years ago)
Author:
wiesep
Message:

Added tangent vector generating

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/shader_HS18/src/libraries/tools/Mesh.cc

    r11783 r12076  
    3535#include <OgreSubEntity.h>
    3636#include <OgreSceneManager.h>
     37#include <OgreHardwareVertexBuffer.h>
    3738
    3839#include "util/Convert.h"
     
    6465            this->scenemanager_->destroyEntity(this->entity_);
    6566
     67   
    6668        if (GameMode::showsGraphics())
    6769        {
     
    7072                this->entity_ = this->scenemanager_->createEntity("Mesh" + multi_cast<std::string>(Mesh::meshCounter_s++), meshsource);
    7173                this->entity_->setCastShadows(this->bCastShadows_);
     74
     75               
     76                unsigned short src, dest;
     77                if (!this->entity_->getMesh()->suggestTangentVectorBuildParams(Ogre::VertexElementSemantic::VES_TANGENT, src, dest))
     78                {
     79                    orxout() << "Generate Tanget for \"" << meshsource << '"' << endl;
     80                    this->entity_->getMesh()->buildTangentVectors(Ogre::VertexElementSemantic::VES_TANGENT, src, dest);
     81                    // this version cleans mirrored and rotated UVs but requires quality models
     82                    // mesh->buildTangentVectors(VES_TANGENT, src, dest, true, true);
     83                }
     84
    7285            }
    7386            catch (...)
Note: See TracChangeset for help on using the changeset viewer.