mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01: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 <ModelEntityItem.h>
|
||||||
#include <BoxEntityItem.h>
|
#include <BoxEntityItem.h>
|
||||||
|
|
||||||
#include <QOpenGLFramebufferObject>
|
|
||||||
#include <QRgb>
|
|
||||||
|
|
||||||
class RenderableModelEntityItem : public ModelEntityItem {
|
class RenderableModelEntityItem : public ModelEntityItem {
|
||||||
public:
|
public:
|
||||||
static EntityItem* factory(const EntityItemID& entityID, const EntityItemProperties& properties);
|
static EntityItem* factory(const EntityItemID& entityID, const EntityItemProperties& properties);
|
||||||
|
|
|
@ -103,9 +103,6 @@ Model::SkinLocations Model::_skinNormalSpecularMapLocations;
|
||||||
Model::SkinLocations Model::_skinShadowLocations;
|
Model::SkinLocations Model::_skinShadowLocations;
|
||||||
Model::SkinLocations Model::_skinTranslucentLocations;
|
Model::SkinLocations Model::_skinTranslucentLocations;
|
||||||
|
|
||||||
ProgramObject Model::_selectProgram;
|
|
||||||
Model::Locations Model::_selectLocations;
|
|
||||||
|
|
||||||
void Model::setScale(const glm::vec3& scale) {
|
void Model::setScale(const glm::vec3& scale) {
|
||||||
setScaleInternal(scale);
|
setScaleInternal(scale);
|
||||||
// if anyone sets scale manually, then we are no longer scaled to fit
|
// if anyone sets scale manually, then we are no longer scaled to fit
|
||||||
|
@ -390,14 +387,6 @@ void Model::init() {
|
||||||
_skinTranslucentProgram.link();
|
_skinTranslucentProgram.link();
|
||||||
|
|
||||||
initSkinProgram(_skinTranslucentProgram, _skinTranslucentLocations);
|
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;
|
ProgramObject* activeProgram = program;
|
||||||
Locations* activeLocations = locations;
|
Locations* activeLocations = locations;
|
||||||
|
|
||||||
// XXXBHG - hack to render yellow
|
|
||||||
if (mode == SELECT_RENDER_MODE) {
|
|
||||||
//activeProgram = &_selectProgram;
|
|
||||||
//activeLocations = &_selectLocations;
|
|
||||||
// need skin version
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isSkinned) {
|
if (isSkinned) {
|
||||||
activeProgram = skinProgram;
|
activeProgram = skinProgram;
|
||||||
activeLocations = skinLocations;
|
activeLocations = skinLocations;
|
||||||
|
|
|
@ -86,7 +86,7 @@ public:
|
||||||
void reset();
|
void reset();
|
||||||
virtual void simulate(float deltaTime, bool fullUpdate = true);
|
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);
|
bool render(float alpha = 1.0f, RenderMode mode = DEFAULT_RENDER_MODE, RenderArgs* args = NULL);
|
||||||
|
|
||||||
|
@ -319,8 +319,6 @@ private:
|
||||||
|
|
||||||
static ProgramObject _skinShadowProgram;
|
static ProgramObject _skinShadowProgram;
|
||||||
|
|
||||||
static ProgramObject _selectProgram;
|
|
||||||
|
|
||||||
static int _normalMapTangentLocation;
|
static int _normalMapTangentLocation;
|
||||||
static int _normalSpecularMapTangentLocation;
|
static int _normalSpecularMapTangentLocation;
|
||||||
|
|
||||||
|
@ -345,8 +343,6 @@ private:
|
||||||
static Locations _lightmapSpecularMapLocations;
|
static Locations _lightmapSpecularMapLocations;
|
||||||
static Locations _lightmapNormalSpecularMapLocations;
|
static Locations _lightmapNormalSpecularMapLocations;
|
||||||
|
|
||||||
static Locations _selectLocations;
|
|
||||||
|
|
||||||
static void initProgram(ProgramObject& program, Locations& locations, int specularTextureUnit = 1);
|
static void initProgram(ProgramObject& program, Locations& locations, int specularTextureUnit = 1);
|
||||||
|
|
||||||
class SkinLocations : public Locations {
|
class SkinLocations : public Locations {
|
||||||
|
|
Loading…
Reference in a new issue