mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +02:00
more work on improved model picking
This commit is contained in:
parent
f13bf65554
commit
6b5fdceb6e
3 changed files with 1 additions and 26 deletions
|
@ -28,9 +28,6 @@
|
|||
#include <ModelEntityItem.h>
|
||||
#include <BoxEntityItem.h>
|
||||
|
||||
#include <QOpenGLFramebufferObject>
|
||||
#include <QRgb>
|
||||
|
||||
class RenderableModelEntityItem : public ModelEntityItem {
|
||||
public:
|
||||
static EntityItem* factory(const EntityItemID& entityID, const EntityItemProperties& properties);
|
||||
|
|
|
@ -103,9 +103,6 @@ Model::SkinLocations Model::_skinNormalSpecularMapLocations;
|
|||
Model::SkinLocations Model::_skinShadowLocations;
|
||||
Model::SkinLocations Model::_skinTranslucentLocations;
|
||||
|
||||
ProgramObject Model::_selectProgram;
|
||||
Model::Locations Model::_selectLocations;
|
||||
|
||||
void Model::setScale(const glm::vec3& scale) {
|
||||
setScaleInternal(scale);
|
||||
// if anyone sets scale manually, then we are no longer scaled to fit
|
||||
|
@ -390,14 +387,6 @@ void Model::init() {
|
|||
_skinTranslucentProgram.link();
|
||||
|
||||
initSkinProgram(_skinTranslucentProgram, _skinTranslucentLocations);
|
||||
|
||||
|
||||
// select/ray picking program
|
||||
_selectProgram.addShaderFromSourceFile(QGLShader::Vertex, Application::resourcesPath() + "shaders/select.vert");
|
||||
_selectProgram.addShaderFromSourceFile(QGLShader::Fragment, Application::resourcesPath() + "shaders/select.frag");
|
||||
_selectProgram.link();
|
||||
initProgram(_selectProgram, _selectLocations);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2166,13 +2155,6 @@ void Model::pickPrograms(gpu::Batch& batch, RenderMode mode, bool translucent, f
|
|||
ProgramObject* activeProgram = program;
|
||||
Locations* activeLocations = locations;
|
||||
|
||||
// XXXBHG - hack to render yellow
|
||||
if (mode == SELECT_RENDER_MODE) {
|
||||
//activeProgram = &_selectProgram;
|
||||
//activeLocations = &_selectLocations;
|
||||
// need skin version
|
||||
}
|
||||
|
||||
if (isSkinned) {
|
||||
activeProgram = skinProgram;
|
||||
activeLocations = skinLocations;
|
||||
|
|
|
@ -86,7 +86,7 @@ public:
|
|||
void reset();
|
||||
virtual void simulate(float deltaTime, bool fullUpdate = true);
|
||||
|
||||
enum RenderMode { DEFAULT_RENDER_MODE, SHADOW_RENDER_MODE, DIFFUSE_RENDER_MODE, NORMAL_RENDER_MODE, SELECT_RENDER_MODE };
|
||||
enum RenderMode { DEFAULT_RENDER_MODE, SHADOW_RENDER_MODE, DIFFUSE_RENDER_MODE, NORMAL_RENDER_MODE };
|
||||
|
||||
bool render(float alpha = 1.0f, RenderMode mode = DEFAULT_RENDER_MODE, RenderArgs* args = NULL);
|
||||
|
||||
|
@ -319,8 +319,6 @@ private:
|
|||
|
||||
static ProgramObject _skinShadowProgram;
|
||||
|
||||
static ProgramObject _selectProgram;
|
||||
|
||||
static int _normalMapTangentLocation;
|
||||
static int _normalSpecularMapTangentLocation;
|
||||
|
||||
|
@ -345,8 +343,6 @@ private:
|
|||
static Locations _lightmapSpecularMapLocations;
|
||||
static Locations _lightmapNormalSpecularMapLocations;
|
||||
|
||||
static Locations _selectLocations;
|
||||
|
||||
static void initProgram(ProgramObject& program, Locations& locations, int specularTextureUnit = 1);
|
||||
|
||||
class SkinLocations : public Locations {
|
||||
|
|
Loading…
Reference in a new issue