Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e000408593 | |||
| 937bf823f3 | |||
| e35b09cc68 | |||
| b172526e62 | |||
| 551745b0a6 | |||
| 8b89df0095 | |||
| b094b9feca | |||
| 0a94373f3f | |||
| 7ced9e6767 |
+1
-1
Submodule assets updated: 85d96f6f3d...007b54bd67
@@ -26,24 +26,13 @@ struct ModelJob : RenderJob
|
|||||||
ModelID = model->ResourceID;
|
ModelID = model->ResourceID;
|
||||||
Type = matProp.type;
|
Type = matProp.type;
|
||||||
::RawModel::MaterialBasic* matGroup = matProp.material;
|
::RawModel::MaterialBasic* matGroup = matProp.material;
|
||||||
|
ShaderID = matProp.ShaderID;
|
||||||
switch(matProp.type){
|
switch(matProp.type){
|
||||||
case ::RawModel::MaterialType::Basic:
|
case ::RawModel::MaterialType::Basic:
|
||||||
if (Model->IsSkinned()) {
|
|
||||||
ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusSkinnedProgram")->ResourceID;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusProgram")->ResourceID;
|
|
||||||
}
|
|
||||||
TextureID = 0;
|
TextureID = 0;
|
||||||
break;
|
break;
|
||||||
case ::RawModel::MaterialType::SingleTextures:
|
case ::RawModel::MaterialType::SingleTextures:
|
||||||
{
|
{
|
||||||
if (Model->IsSkinned()) {
|
|
||||||
ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusSkinnedProgram")->ResourceID;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusProgram")->ResourceID;
|
|
||||||
}
|
|
||||||
::RawModel::MaterialSingleTextures* singleTextures = static_cast<::RawModel::MaterialSingleTextures*>(matProp.material);
|
::RawModel::MaterialSingleTextures* singleTextures = static_cast<::RawModel::MaterialSingleTextures*>(matProp.material);
|
||||||
TextureID = (singleTextures->ColorMap.Texture) ? singleTextures->ColorMap.Texture->ResourceID : 0;
|
TextureID = (singleTextures->ColorMap.Texture) ? singleTextures->ColorMap.Texture->ResourceID : 0;
|
||||||
if (modelComponent["DiffuseTexture"]) {
|
if (modelComponent["DiffuseTexture"]) {
|
||||||
@@ -65,12 +54,6 @@ struct ModelJob : RenderJob
|
|||||||
break;
|
break;
|
||||||
case ::RawModel::MaterialType::SplatMapping:
|
case ::RawModel::MaterialType::SplatMapping:
|
||||||
{
|
{
|
||||||
if (Model->IsSkinned()) {
|
|
||||||
ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusSplatMapSkinnedProgram")->ResourceID;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusSplatMapProgram")->ResourceID;
|
|
||||||
}
|
|
||||||
::RawModel::MaterialSplatMapping* SplatTextures = static_cast<::RawModel::MaterialSplatMapping*>(matProp.material);
|
::RawModel::MaterialSplatMapping* SplatTextures = static_cast<::RawModel::MaterialSplatMapping*>(matProp.material);
|
||||||
|
|
||||||
SplatMap = &SplatTextures->SplatMap;
|
SplatMap = &SplatTextures->SplatMap;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "../Core/ResourceManager.h"
|
#include "../Core/ResourceManager.h"
|
||||||
#include "Texture.h"
|
#include "Texture.h"
|
||||||
#include "Skeleton.h"
|
#include "Skeleton.h"
|
||||||
|
#include "ShaderProgram.h"
|
||||||
|
|
||||||
#include "boost\endian\buffers.hpp"
|
#include "boost\endian\buffers.hpp"
|
||||||
|
|
||||||
@@ -87,6 +88,7 @@ public:
|
|||||||
struct MaterialProperties {
|
struct MaterialProperties {
|
||||||
MaterialType type;
|
MaterialType type;
|
||||||
MaterialBasic* material;
|
MaterialBasic* material;
|
||||||
|
unsigned int ShaderID = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Vertex* Vertices() const {
|
const Vertex* Vertices() const {
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ private:
|
|||||||
bool CapturePointSystem::OnTriggerLeave(const Events::TriggerLeave& e);
|
bool CapturePointSystem::OnTriggerLeave(const Events::TriggerLeave& e);
|
||||||
EventRelay<CapturePointSystem, Events::Captured> m_ECaptured;
|
EventRelay<CapturePointSystem, Events::Captured> m_ECaptured;
|
||||||
bool CapturePointSystem::OnCaptured(const Events::Captured& e);
|
bool CapturePointSystem::OnCaptured(const Events::Captured& e);
|
||||||
|
void ChangeCapturePointModelsVisibility(EntityWrapper &capturePointModels, bool isOwner);
|
||||||
|
|
||||||
bool m_WinnerWasFound = false;
|
bool m_WinnerWasFound = false;
|
||||||
//need to track these variables for the captureSystem to work as per design!
|
//need to track these variables for the captureSystem to work as per design!
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
</c:Team>
|
</c:Team>
|
||||||
<c:PlayerSpawn/>
|
<c:PlayerSpawn/>
|
||||||
<c:Spawner>
|
<c:Spawner>
|
||||||
<EntityFile>Schema/Entities/Player.xml</EntityFile>
|
<EntityFile>Schema/Entities/PlayerRed.xml</EntityFile>
|
||||||
</c:Spawner>
|
</c:Spawner>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -225,6 +225,11 @@
|
|||||||
</Team>
|
</Team>
|
||||||
</c:Team>
|
</c:Team>
|
||||||
<c:Trigger/>
|
<c:Trigger/>
|
||||||
|
<c:Model>
|
||||||
|
<Resource></Resource>
|
||||||
|
<Color A="0.300000012" B="0" G="0" R="1"/>
|
||||||
|
<Visible>false</Visible>
|
||||||
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="-4.10000038"/>
|
<Position X="0" Y="0" Z="-4.10000038"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
@@ -239,7 +244,17 @@
|
|||||||
<Scale X="2.70000005" Y="3.4000001" Z="4.60000038"/>
|
<Scale X="2.70000005" Y="3.4000001" Z="4.60000038"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource></Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="Blue">
|
<Entity name="Blue">
|
||||||
<Components>
|
<Components>
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ DrawFinalPassState::DrawFinalPassState(GLuint frameBuffer)
|
|||||||
Enable(GL_DEPTH_TEST);
|
Enable(GL_DEPTH_TEST);
|
||||||
DepthMask(GL_TRUE);
|
DepthMask(GL_TRUE);
|
||||||
Enable(GL_CULL_FACE);
|
Enable(GL_CULL_FACE);
|
||||||
|
Enable(GL_ALPHA_TEST);
|
||||||
|
AlphaFunc(GL_GEQUAL, 0.05f);
|
||||||
// Enable(GL_STENCIL_TEST);
|
// Enable(GL_STENCIL_TEST);
|
||||||
// StencilFunc(GL_NOTEQUAL, 1, 0xFF);
|
// StencilFunc(GL_NOTEQUAL, 1, 0xFF);
|
||||||
// StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
// StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
||||||
|
|||||||
@@ -148,14 +148,29 @@ void RawModelCustom::ReadMaterialSingle(std::size_t& offset, char* fileData, con
|
|||||||
case MaterialType::Basic:
|
case MaterialType::Basic:
|
||||||
newMaterialProperty.material = new MaterialBasic();
|
newMaterialProperty.material = new MaterialBasic();
|
||||||
ReadMaterialBasic(newMaterialProperty.material, offset, fileData, fileByteSize);
|
ReadMaterialBasic(newMaterialProperty.material, offset, fileData, fileByteSize);
|
||||||
|
if(hasSkin){
|
||||||
|
newMaterialProperty.ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusSkinnedProgram")->ResourceID;
|
||||||
|
} else {
|
||||||
|
newMaterialProperty.ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusProgram")->ResourceID;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MaterialType::SplatMapping:
|
case MaterialType::SplatMapping:
|
||||||
newMaterialProperty.material = new MaterialSplatMapping();
|
newMaterialProperty.material = new MaterialSplatMapping();
|
||||||
ReadMaterialSplatMapping(static_cast<MaterialSplatMapping*>(newMaterialProperty.material), offset, fileData, fileByteSize);
|
ReadMaterialSplatMapping(static_cast<MaterialSplatMapping*>(newMaterialProperty.material), offset, fileData, fileByteSize);
|
||||||
|
if (hasSkin){
|
||||||
|
newMaterialProperty.ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusSplatMapSkinnedProgram")->ResourceID;
|
||||||
|
} else {
|
||||||
|
newMaterialProperty.ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusSplatMapProgram")->ResourceID;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MaterialType::SingleTextures:
|
case MaterialType::SingleTextures:
|
||||||
newMaterialProperty.material = new MaterialSingleTextures();
|
newMaterialProperty.material = new MaterialSingleTextures();
|
||||||
ReadMaterialSingleTexture(static_cast<MaterialSingleTextures*>(newMaterialProperty.material), offset, fileData, fileByteSize);
|
ReadMaterialSingleTexture(static_cast<MaterialSingleTextures*>(newMaterialProperty.material), offset, fileData, fileByteSize);
|
||||||
|
if (hasSkin){
|
||||||
|
newMaterialProperty.ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusSkinnedProgram")->ResourceID;
|
||||||
|
} else {
|
||||||
|
newMaterialProperty.ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusProgram")->ResourceID;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw Resource::FailedLoadingException("Material contains an unknown MaterialType");
|
throw Resource::FailedLoadingException("Material contains an unknown MaterialType");
|
||||||
|
|||||||
@@ -108,10 +108,10 @@ void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, Comp
|
|||||||
//change what model is displaying (change all in case 2 capturepoints has been captured on the same frame)
|
//change what model is displaying (change all in case 2 capturepoints has been captured on the same frame)
|
||||||
for (int i = 0; i < m_NumberOfCapturePoints; i++) {
|
for (int i = 0; i < m_NumberOfCapturePoints; i++) {
|
||||||
auto owner = (int)m_CapturePointNumberToEntityMap[i]["Team"]["Team"];
|
auto owner = (int)m_CapturePointNumberToEntityMap[i]["Team"]["Team"];
|
||||||
if (m_CapturePointNumberToEntityMap[i].FirstChildByName("Red").ID != EntityID_Invalid) {
|
if (m_CapturePointNumberToEntityMap[i].FirstChildByName("Red").Valid()) {
|
||||||
(bool&)m_CapturePointNumberToEntityMap[i].FirstChildByName("Red")["Model"]["Visible"] = owner == redTeam ? true : false;
|
ChangeCapturePointModelsVisibility(m_CapturePointNumberToEntityMap[i].FirstChildByName("Red"), owner == redTeam);
|
||||||
(bool&)m_CapturePointNumberToEntityMap[i].FirstChildByName("Blue")["Model"]["Visible"] = owner == blueTeam ? true : false;
|
ChangeCapturePointModelsVisibility(m_CapturePointNumberToEntityMap[i].FirstChildByName("Blue"), owner == blueTeam);
|
||||||
(bool&)m_CapturePointNumberToEntityMap[i].FirstChildByName("Spectator")["Model"]["Visible"] = owner == spectatorTeam ? true : false;
|
ChangeCapturePointModelsVisibility(m_CapturePointNumberToEntityMap[i].FirstChildByName("Spectator"), owner == spectatorTeam);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//save the next cap points and publish the captured event
|
//save the next cap points and publish the captured event
|
||||||
@@ -232,6 +232,14 @@ void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, Comp
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CapturePointSystem::ChangeCapturePointModelsVisibility(EntityWrapper &capturePointModels, bool isOwner) {
|
||||||
|
(bool&)capturePointModels["Model"]["Visible"] = isOwner;
|
||||||
|
for (auto& capModel : capturePointModels.ChildrenWithComponent("Model"))
|
||||||
|
{
|
||||||
|
(bool&)capModel["Model"]["Visible"] = isOwner;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool CapturePointSystem::OnTriggerTouch(const Events::TriggerTouch& e)
|
bool CapturePointSystem::OnTriggerTouch(const Events::TriggerTouch& e)
|
||||||
{
|
{
|
||||||
//personEntered = e.Entity, thingEntered = e.Trigger
|
//personEntered = e.Entity, thingEntered = e.Trigger
|
||||||
|
|||||||
Reference in New Issue
Block a user