GitLab Commit is coming up on August 3-4. Learn how to innovate together using GitLab, the DevOps platform. Register for free: gitlabcommitvirtual2021.com

Verified Commit 0ed2f94c authored by Martin Mauersics's avatar Martin Mauersics 🌱
Browse files

updated everything to the latest engine version

parent 62a74380
......@@ -9,18 +9,16 @@
// ****************************************************************
// #version #
// #define _CORE_*_SHADER_ 1
// #define _CORE_QUALITY_ #
// #define CORE_TEXTURE_UNITS #
// #define CORE_GRAPHICS_LIGHTS #
// #define CORE_SHADER_OUTPUT_COLORS #
// global definitions
#define PI (3.1415926535897932384626433832795)
#define EU (2.7182818284590452353602874713527)
// #version (#) // shader version
// #define _CORE_*_SHADER_ (1) // shader type (vertex, fragment, ...)
// #define _CORE_OPTION_*_ (1) // multiple preprocessor options
// #define _CORE_QUALITY_ (#) // quality level
// #define CORE_NUM_TEXTURES (#) // number of texture units
// #define CORE_NUM_LIGHTS (#) // number of light sources
// #define CORE_NUM_OUTPUTS (#) // number of output colors
// extensions
#extension AMD_shader_trinary_minmax : enable
// precision qualifier
#ifdef GL_ES
......@@ -29,7 +27,6 @@
#endif
#endif
// light structure
struct coreLight
{
......@@ -39,6 +36,7 @@ struct coreLight
};
// ****************************************************************
#if (__VERSION__) >= 140 // >= OpenGL 3.1
layout(std140) uniform b_Global
......@@ -51,7 +49,7 @@ struct coreLight
vec4 u_v4Resolution;
// ambient uniforms
coreLight u_asLight[CORE_GRAPHICS_LIGHTS];
coreLight u_asLight[CORE_NUM_LIGHTS];
};
#else
......@@ -64,49 +62,28 @@ struct coreLight
uniform vec4 u_v4Resolution;
// ambient uniforms
uniform coreLight u_asLight[CORE_GRAPHICS_LIGHTS];
uniform coreLight u_asLight[CORE_NUM_LIGHTS];
#endif
// 3d-object uniforms
uniform mat4 u_m4ModelView;
uniform mat4 u_m4ModelViewProj;
uniform mat3 u_m3Normal;
// 2d-object uniforms
uniform mat4 u_m4ScreenView;
uniform mat3 u_m3ScreenView;
// default object uniforms
uniform vec4 u_v4Color;
uniform vec2 u_v2TexSize;
uniform vec2 u_v2TexOffset;
uniform vec4 u_v4TexParam;
// texture uniforms
uniform sampler2D u_as2Texture[CORE_TEXTURE_UNITS];
uniform sampler2D u_as2Texture[CORE_NUM_TEXTURES];
// square length function
float coreLengthSq(in vec2 v) {return dot(v, v);}
float coreLengthSq(in vec3 v) {return dot(v, v);}
#if (__VERSION__) >= 400 // >= OpenGL 4.0
// unpacking function
vec4 coreUnpackUnorm4x8(in uint x) {return unpackUnorm4x8(x);}
#elif (__VERSION__) >= 130 // >= OpenGL 3.0
// unpacking function
vec4 coreUnpackUnorm4x8(in uint x)
{
return vec4(float( x & 0xFF),
float((x >> 8) & 0xFF),
float((x >> 16) & 0xFF),
float((x >> 24) & 0xFF)) * 0.003921569);
}
#endif
// remapped variables
vec2 u_v2TexSize = u_v4TexParam.xy;
vec2 u_v2TexOffset = u_v4TexParam.zw;
// ****************************************************************
......@@ -119,12 +96,20 @@ float coreLengthSq(in vec3 v) {return dot(v, v);}
in vec2 a_v2Texture;
in vec3 a_v3Normal;
in vec4 a_v4Tangent;
// instancing attributes
in mat4 a_m4DivModelView;
in vec3 a_v3DivPosition;
in vec3 a_v3DivData;
in uint a_iDivColor;
in vec4 a_v4DivTexParam;
// shader output
out b_Varying
{
vec2 v_av2TexCoord[CORE_TEXTURE_UNITS];
vec4 v_av4LightDir[CORE_GRAPHICS_LIGHTS];
vec4 v_v4VarColor;
vec2 v_av2TexCoord[CORE_NUM_TEXTURES];
vec4 v_av4LightDir[CORE_NUM_LIGHTS];
vec3 v_v3ViewDir;
};
......@@ -135,13 +120,28 @@ float coreLengthSq(in vec3 v) {return dot(v, v);}
attribute vec2 a_v2Texture;
attribute vec3 a_v3Normal;
attribute vec4 a_v4Tangent;
// instancing uniforms (used like attributes)
uniform mat4 a_m4DivModelView;
uniform vec3 a_v3DivPosition;
uniform vec3 a_v3DivData;
uniform vec4 a_iDivColor;
uniform vec4 a_v4DivTexParam;
// shader output
varying vec2 v_av2TexCoord[CORE_TEXTURE_UNITS];
varying vec4 v_av4LightDir[CORE_GRAPHICS_LIGHTS];
varying vec4 v_v4VarColor;
varying vec2 v_av2TexCoord[CORE_NUM_TEXTURES];
varying vec4 v_av4LightDir[CORE_NUM_LIGHTS];
varying vec3 v_v3ViewDir;
#endif
// remapped variables
float a_fDivScale = a_v3DivData.x;
float a_fDivAngle = a_v3DivData.y;
float a_fDivValue = a_v3DivData.z;
vec2 a_v2DivTexSize = a_v4DivTexParam.xy;
vec2 a_v2DivTexOffset = a_v4DivTexParam.zw;
#endif // _CORE_VERTEX_SHADER_
......@@ -164,16 +164,18 @@ float coreLengthSq(in vec3 v) {return dot(v, v);}
// shader input
in b_Varying
{
vec2 v_av2TexCoord[CORE_TEXTURE_UNITS];
vec4 v_av4LightDir[CORE_GRAPHICS_LIGHTS];
vec4 v_v4VarColor;
vec2 v_av2TexCoord[CORE_NUM_TEXTURES];
vec4 v_av4LightDir[CORE_NUM_LIGHTS];
vec3 v_v3ViewDir;
} In[];
// shader output
out b_Varying
{
vec2 v_av2TexCoord[CORE_TEXTURE_UNITS];
vec4 v_av4LightDir[CORE_GRAPHICS_LIGHTS];
vec4 v_v4VarColor;
vec2 v_av2TexCoord[CORE_NUM_TEXTURES];
vec4 v_av4LightDir[CORE_NUM_LIGHTS];
vec3 v_v3ViewDir;
} Out;
......@@ -188,19 +190,21 @@ float coreLengthSq(in vec3 v) {return dot(v, v);}
// shader input
in b_Varying
{
vec2 v_av2TexCoord[CORE_TEXTURE_UNITS];
vec4 v_av4LightDir[CORE_GRAPHICS_LIGHTS];
vec4 v_v4VarColor;
vec2 v_av2TexCoord[CORE_NUM_TEXTURES];
vec4 v_av4LightDir[CORE_NUM_LIGHTS];
vec3 v_v3ViewDir;
};
// shader output
out vec4 o_av4Color[CORE_SHADER_OUTPUT_COLORS];
out vec4 o_av4OutColor[CORE_NUM_OUTPUTS];
#else
// shader input
varying vec2 v_av2TexCoord[CORE_TEXTURE_UNITS];
varying vec4 v_av4LightDir[CORE_GRAPHICS_LIGHTS];
varying vec4 v_v4VarColor;
varying vec2 v_av2TexCoord[CORE_NUM_TEXTURES];
varying vec4 v_av4LightDir[CORE_NUM_LIGHTS];
varying vec3 v_v3ViewDir;
#endif
......@@ -208,4 +212,81 @@ float coreLengthSq(in vec3 v) {return dot(v, v);}
#endif // _CORE_FRAGMENT_SHADER_
// ****************************************************************
#define PI (3.1415926535897932384626433832795)
#define EU (2.7182818284590452353602874713527)
// trinary min and max functions
#ifdef GL_AMD_shader_trinary_minmax
#define coreMin3(a,b,c) (min3(a, b, c))
#define coreMax3(a,b,c) (max3(a, b, c))
#else
#define coreMin3(a,b,c) (min(a, min(b, c)))
#define coreMax3(a,b,c) (max(a, max(b, c)))
#endif
// square length functions
float coreLengthSq(in vec2 v) {return dot(v, v);}
float coreLengthSq(in vec3 v) {return dot(v, v);}
// color convert functions
vec3 coreHSVtoRGB(in vec3 v3HSV)
{
float H = v3HSV.x * 6.0;
float S = v3HSV.y;
float V = v3HSV.z;
float h = floor(H);
float f = H - h;
float VS = V * S;
float VR = VS * f;
float p = V - VS;
float q = V - VR;
float t = p + VR;
if(h == 1.0) return vec3(q, V, p);
if(h == 2.0) return vec3(p, V, t);
if(h == 3.0) return vec3(p, q, V);
if(h == 4.0) return vec3(t, p, V);
if(h == 5.0) return vec3(V, p, q);
return vec3(V, t, p);
}
vec3 coreRGBtoHSV(in vec3 v3RGB)
{
float R = v3RGB.r;
float G = v3RGB.g;
float B = v3RGB.b;
float v = coreMax3(R, G, B);
float d = v - coreMin3(R, G, B);
if(d == 0.0) return vec3(0.0, 0.0, v);
if(R == v) return vec3((0.0 + (G - B) / d) / 6.0, d / v, v);
else if(G == v) return vec3((2.0 + (B - R) / d) / 6.0, d / v, v);
else return vec3((4.0 + (R - G) / d) / 6.0, d / v, v);
}
// pack and unpacking functions
#if (__VERSION__) >= 400 // >= OpenGL 4.0
vec4 coreUnpackUnorm4x8(in uint x) {return unpackUnorm4x8(x);}
#elif (__VERSION__) >= 130 // >= OpenGL 3.0
vec4 coreUnpackUnorm4x8(in uint x)
{
return vec4(float( x & 0xFFu),
float((x >> 8) & 0xFFu),
float((x >> 16) & 0xFFu),
float((x >> 24) & 0xFFu)) * 0.003921569;
}
#else
#define coreUnpackUnorm4x8(x) (x)
#endif
#line 1
\ No newline at end of file
......@@ -30,22 +30,13 @@ cBackground::cBackground()noexcept
this->LoadGeometry();
// load object resources
this->DefineTextureFile(0, "data/textures/background.png");
this->DefineTextureFile(1, "data/textures/background_norm.png");
this->DefineProgramShare("floor_shader")
->AttachShaderFile("data/shaders/floor.vs")
->AttachShaderFile("data/shaders/floor.fs")
->BindAttribute("a_v2Position", 0)
->BindAttribute("a_v4Color", 2)
->BindAttribute("a_fHeight", 3)
->Finish();
this->DefineTexture(0, "background.png");
this->DefineTexture(1, "background_norm.png");
this->DefineProgram("floor_program");
// create filling background
m_Fill.DefineTextureFile(0, "data/textures/background.png");
m_Fill.DefineProgramShare("fill_shader")
->AttachShaderFile("data/shaders/fill.vs")
->AttachShaderFile("data/shaders/fill.fs")
->Finish();
m_Fill.DefineTexture(0, "background.png");
m_Fill.DefineProgram("fill_program");
m_Fill.FitToScreen();
m_Fill.SetTexSize(m_Fill.GetSize()*7.2f);
}
......@@ -79,7 +70,7 @@ void cBackground::Render()
m_fLightTime += Core::System->GetTime() * fSpeed * (1.0f + MAX((g_fCurSpeed - 1.5f) * 0.16667f, 0.0f));
// check for new tick
const int iNewTick = (int)std::floor(m_fLightTime);
const int iNewTick = (int)FLOOR(m_fLightTime);
if(m_iLightTick < iNewTick)
{
// create flash
......@@ -105,9 +96,7 @@ void cBackground::Render()
if(this->Enable())
{
// draw the model
coreModel::Lock();
glDrawRangeElements(m_pModel->GetPrimitiveType(), 0, BACK_BLOCKS * BACK_PER_VERTICES, BACK_RANGE, m_pModel->GetIndexType(), r_cast<const GLvoid*>(m_iOffset));
coreModel::Unlock();
}
// render the filling background
......@@ -126,7 +115,7 @@ void cBackground::Move()
if(m_fPositionTime > BACK_REPEAT) m_fPositionTime -= BACK_REPEAT;
// calculate drawing offset and background position
m_iOffset = coreUint(std::floor(m_fPositionTime)) * BACK_BLOCKS_X * BACK_PER_INDICES * sizeof(coreWord);
m_iOffset = coreUint(FLOOR(m_fPositionTime)) * BACK_BLOCKS_X * BACK_PER_INDICES * sizeof(coreUshort);
this->SetPosition(coreVector3(0.0f, -m_fPositionTime * BACK_DETAIL_Y, GAME_HEIGHT));
// update dance floor light animation
......@@ -148,28 +137,24 @@ void cBackground::Move()
// ****************************************************************
void cBackground::UpdateHoles(const coreUint& iLine, const bool* pbIndex)
{
coreModel::Lock();
{
constexpr_var coreUint iNum = BACK_BLOCKS_X * BACK_PER_VERTICES;
constexpr_var coreUint iSize = iNum * sizeof(float);
constexpr_var coreUint iNum = BACK_BLOCKS_X * BACK_PER_VERTICES;
constexpr_var coreUint iSize = iNum * sizeof(float);
// map required area
float* pfData = m_pModel->GetVertexBuffer(1)->Map<float>(iLine*iSize, iSize, false);
ASSERT((iLine+1) * iSize < BACK_TOTAL_INDICES * sizeof(float));
// map required area
float* pfData = m_pModel->GetVertexBuffer(1)->Map<float>(iLine*iSize, iSize, false);
ASSERT((iLine+1) * iSize < BACK_TOTAL_INDICES * sizeof(float));
// set height values of the selected line
for(coreUint i = 0; i < iNum; ++i)
{
pfData[i] = m_pfHeight[i + iLine*iNum] = pbIndex[i/BACK_PER_VERTICES] ? 100.0f : 0.0f;
}
// set height values of the selected line
for(coreUint i = 0; i < iNum; ++i)
{
pfData[i] = m_pfHeight[i + iLine*iNum] = pbIndex[i/BACK_PER_VERTICES] ? 100.0f : 0.0f;
}
// unmap area
m_pModel->GetVertexBuffer(1)->Unmap(pfData);
// unmap area
m_pModel->GetVertexBuffer(1)->Unmap(pfData);
// reset current model object
coreModel::Disable(false);
}
coreModel::Unlock();
// reset current model object
coreModel::Disable(false);
}
......@@ -181,11 +166,11 @@ float cBackground::GetHeight(const coreVector2& vPos, const coreVector2& vBackPo
const float fY = (vPos.y-vBackPos.y) / BACK_DETAIL_Y + BACK_OFFSET_Y;
// retrieve height value of the block
return m_pfHeight[(int(std::floor(fX)) + int(std::floor(fY))*BACK_BLOCKS_X) * BACK_PER_VERTICES];
return m_pfHeight[(int(FLOOR(fX)) + int(FLOOR(fY))*BACK_BLOCKS_X) * BACK_PER_VERTICES];
/*
// retrieve all four corners of the block
const int iI00 = (int(std::floor(fX)) + int(std::floor(fY))*BACK_BLOCKS_X) * BACK_PER_VERTICES;
const int iI00 = (int(FLOOR(fX)) + int(FLOOR(fY))*BACK_BLOCKS_X) * BACK_PER_VERTICES;
const int iI01 = iI00 + 1;
const int iI10 = iI00 + 2;
const int iI11 = iI00 + 3;
......@@ -208,9 +193,9 @@ float cBackground::GetHeight(const coreVector2& vPos, const coreVector2& vBackPo
// ****************************************************************
void cBackground::LoadGeometry()
{
std::vector<coreVector4> avColor; avColor.reserve(BACK_BLOCKS);
std::vector<sVertex> m_pVertexData; m_pVertexData.reserve(BACK_TOTAL_VERTICES);
std::vector<coreWord> m_pIndexData; m_pIndexData.reserve(BACK_TOTAL_INDICES);
std::vector<coreVector4> avColor; avColor.reserve (BACK_BLOCKS);
std::vector<sVertex> m_pVertexData; m_pVertexData.reserve(BACK_TOTAL_VERTICES);
std::vector<coreUshort> m_pIndexData; m_pIndexData.reserve (BACK_TOTAL_INDICES);
// delete old data
m_pModel->Unload();
......@@ -265,8 +250,8 @@ void cBackground::LoadGeometry()
{
const coreUint j = x + y*BACK_WIDTH;
const coreVector4& vColor = avColor[x + y*BACK_BLOCKS_X];
const coreWord iStartIndex = m_pVertexData.size();
const coreVector4& vColor = avColor[x + y*BACK_BLOCKS_X];
const coreUshort iStartIndex = m_pVertexData.size();
// copy base vertices to create unique plates and add generated color values
m_pVertexData.push_back(pBaseVertex[j]); m_pVertexData.back().vColor = vColor;
......@@ -297,7 +282,7 @@ void cBackground::LoadGeometry()
pBuffer->DefineAttribute(3, 1, GL_FLOAT, 0);
// create index buffer
m_pModel->CreateIndexBuffer(BACK_TOTAL_INDICES, sizeof(coreWord), m_pIndexData.data(), GL_STATIC_DRAW);
m_pModel->CreateIndexBuffer(BACK_TOTAL_INDICES, sizeof(coreUshort), m_pIndexData.data(), GL_STATIC_DRAW);
// clear memory
avColor.clear();
......
......@@ -19,22 +19,22 @@
#define BACK_BLOCKS_Y (BACK_HEIGHT-1) // blocks per column
#define BACK_BLOCKS (BACK_BLOCKS_X*BACK_BLOCKS_Y) // number of all blocks
#define BACK_PER_VERTICES 4 // vertices per block
#define BACK_PER_INDICES 6 // indices per block
#define BACK_PER_VERTICES (4) // vertices per block
#define BACK_PER_INDICES (6) // indices per block
#define BACK_TOTAL_VERTICES (BACK_PER_VERTICES*BACK_BLOCKS) // total number of vertices
#define BACK_TOTAL_INDICES (BACK_PER_INDICES*BACK_BLOCKS) // total number of indices
#define BACK_DETAIL_X (24.0f*0.91f) // X size of a block
#define BACK_DETAIL_Y 24.0f // Y size of a block
#define BACK_OFFSET_Y 2.0f // Y position offset
#define BACK_DETAIL_Y (24.0f) // Y size of a block
#define BACK_OFFSET_Y (2.0f) // Y position offset
#define BACK_VIEW 24 // visible rows
#define BACK_REPEAT 40 // rows when to repeat (BACK_VIEW + BACK_REPEAT < BACK_HEIGHT)
#define BACK_VIEW (24) // visible rows
#define BACK_REPEAT (40) // rows when to repeat (BACK_VIEW + BACK_REPEAT < BACK_HEIGHT)
#define BACK_RANGE (BACK_BLOCKS_X * BACK_PER_INDICES * BACK_VIEW) // vertices to draw at once
#define BACK_SPAWN_X(i,o) (BACK_DETAIL_X * (float(i) - (float(BACK_BLOCKS_X)/2.0f - o))) // X position at a specific plate number and with offset
#define BACK_SPAWN_Y (BACK_DETAIL_Y * (BACK_VIEW - BACK_OFFSET_Y + 0.5f)) // Y position at where to spawn objects on the horizon
#define BACK_REMOVE_Y -52.0f // Y position at where to remove objects
#define BACK_REMOVE_Y (-52.0f) // Y position at where to remove objects
// ****************************************************************
......@@ -80,7 +80,7 @@ public:
// make or remove holes, get current horizon line, do other fancy stuff
void UpdateHoles(const coreUint& iLine, const bool* pbIndex);
inline int GetCurLine()const {return (int)std::floor(m_fPositionTime);}
inline int GetCurLine()const {return (int)FLOOR(m_fPositionTime);}
inline float GetFlash(const float& fStrength)const {return 1.0f + (fStrength * (this->GetAlpha() - 1.0f));}
// get height value at specific position
......
......@@ -19,32 +19,23 @@ cBeverage::cBeverage(const int& iScore, const float& fHeight, const float& fAlph
, m_pDestroy (coreTimer(30.0f, 20.0f, 1))
, m_vFlyRotation (coreVector3(0.0f,0.0f,0.0f))
, m_vFlyImpact (coreVector3(0.0f,0.0f,0.0f))
, m_fVolume (fVolume*0.8f)
, m_fVolume (fVolume*0.6f)
, m_fPitch (fPitch*0.65f)
{
// load drink shader
this->DefineProgramShare("drink_shader")
->AttachShaderFile("data/shaders/drink.vs")
->AttachShaderFile("data/shaders/drink.fs")
->Finish();
this->DefineProgram("drink_program");
// create shadow
m_Shadow.DefineTextureFile(0, "data/textures/effect_shadow.png");
m_Shadow.DefineModelFile("data/models/standard_square.md5mesh");
m_Shadow.DefineProgramShare("shadow_shader")
->AttachShaderFile("data/shaders/default_3d_simple.vs")
->AttachShaderFile("data/shaders/shadow.fs")
->Finish();
m_Shadow.DefineTexture(0, "effect_shadow.png");
m_Shadow.DefineModel("default_square.md5mesh");
m_Shadow.DefineProgram("shadow_program");
m_Shadow.SetDirection(coreVector3(0.0f,0.0f,-1.0f));
// load glass shader
m_pGlasProgram = Core::Manager::Memory->Share<coreProgram>("glass_shader");
m_pGlasProgram->AttachShaderFile("data/shaders/glass.vs")
->AttachShaderFile("data/shaders/glass.fs")
->Finish();
m_pGlasProgram = Core::Manager::Resource->Get<coreProgram>("glass_program");
// load sound-effects
m_pClink = Core::Manager::Resource->LoadFile<coreSound>("data/sounds/clink.wav");
m_pClink = Core::Manager::Resource->Get<coreSound>("clink.wav");
}
......@@ -80,7 +71,7 @@ void cBeverage::Move()
}
// calculate vertical position above the ground
const float fGround = m_pModel->GetRadius()*this->GetSize().x + m_pDestroy.GetCurrent(false)*10.0f + m_fHeight + GAME_HEIGHT;
const float fGround = m_pModel->GetRadius()*this->GetSize().x + m_pDestroy.GetValue(CORE_TIMER_GET_NORMAL)*10.0f + m_fHeight + GAME_HEIGHT;
this->SetPosition(coreVector3(this->GetPosition().xy(), fGround) + coreVector3(fSideSet,0.0f,0.0f));
// fade in
......@@ -127,8 +118,8 @@ cSunrise::cSunrise()noexcept
: cBeverage (5, 0.5f, 0.91f, 0.2f, 1.0f)
{
// load object resources
this->DefineModelFile("data/models/drink_sunrise.md5mesh");
this->DefineTextureFile(0, "data/textures/drink_sunrise.png");
this->DefineModel("drink_sunrise.md5mesh");
this->DefineTexture(0, "drink_sunrise.png");
// set object properties
this->SetSize(coreVector3(1.0f,1.0f,1.0f)*3.0f);
......@@ -137,9 +128,9 @@ cSunrise::cSunrise()noexcept
// create straw
m_pStraw = new coreObject3D();
m_pStraw->DefineModelFile("data/models/drink_sunrise_straw.md5mesh");
m_pStraw->DefineTextureFile(0, "data/textures/standard_black.png");
m_pStraw->DefineProgramShare("drink_shader");
m_pStraw->DefineModel("drink_sunrise_straw.md5mesh");
m_pStraw->DefineTexture(0, "default_black.png");
m_pStraw->DefineProgram("drink_program");
}
......@@ -154,8 +145,8 @@ cMojito::cMojito()noexcept
: cBeverage (10, -0.2f, 0.85f, 0.4f, 1.2f)
{
// load object resources
this->DefineModelFile("data/models/drink_mojito.md5mesh");
this->DefineTextureFile(0, "data/textures/drink_mojito.png");
this->DefineModel("drink_mojito.md5mesh");
this->DefineTexture(0, "drink_mojito.png");
// set object properties
this->SetSize(coreVector3(1.0f,1.0f,1.0f)*3.0f);
......@@ -164,9 +155,9 @@ cMojito::cMojito()noexcept
// create straw
m_pStraw = new coreObject3D();
m_pStraw->DefineModelFile("data/models/drink_mojito_straw.md5mesh");
m_pStraw->DefineTextureFile(0, "data/textures/standard_black.png");
m_pStraw->DefineProgramShare("drink_shader");
m_pStraw->DefineModel("drink_mojito_straw.md5mesh");
m_pStraw->DefineTexture(0, "default_black.png");
m_pStraw->DefineProgram("drink_program");
}
......@@ -181,8 +172,8 @@ cBlue::cBlue()noexcept
: cBeverage (30, 5.8f, 0.87f, 0.6f, 1.6f)
{
// load object resources
this->DefineModelFile("data/models/drink_blue.md5mesh");
this->DefineTextureFile(0, "data/textures/drink_blue.png");
this->DefineModel("drink_blue.md5mesh");
this->DefineTexture(0, "drink_blue.png");
// set object properties
this->SetSize(coreVector3(1.0f,1.0f,1.0f)*3.5f);
......@@ -191,15 +182,15 @@ cBlue::cBlue()noexcept
// create straw
m_pStraw = new coreObject3D();
m_pStraw->DefineModelFile("data/models/drink_blue_straw.md5mesh");
m_pStraw->DefineTextureFile(0, "data/textures/drink_citrus.png");
m_pStraw->DefineProgramShare("drink_shader");
m_pStraw->DefineModel("drink_blue_straw.md5mesh");
m_pStraw->DefineTexture(0, "drink_citrus.png");
m_pStraw->DefineProgram("drink_program");
// create glass
m_pGlass = new coreObject3D();
m_pGlass->DefineModelFile("data/models/drink_blue_glass.md5mesh");
m_pGlass->DefineTextureFile(0, "data/textures/drink_blue.png");
m_pGlass->DefineProgramShare("glass_shader");
m_pGlass->DefineModel("drink_blue_glass.md5mesh");
m_pGlass->DefineTexture(0, "drink_blue.png");
m_pGlass->DefineProgram("glass_program");
}