PipelineInfo::CullMode and PipelineInfo::RasterMode are no longer within the PipelineInfo class, enabling easier forward declaration.
KRMaterial::bind now accepts remaining parameters required to set up the pipeline. Removed GL calls from KRModel. Replaced ifdef guards with pragma once. KRMesh::model_format_t changed to ModelFormat and is no longer within KRMesh, enabling easier forward declaration.
This commit is contained in:
@@ -140,7 +140,7 @@ void KRAmbientZone::render(RenderInfo& ri)
|
|||||||
info.directional_lights = &ri.directional_lights;
|
info.directional_lights = &ri.directional_lights;
|
||||||
info.spot_lights = &ri.spot_lights;
|
info.spot_lights = &ri.spot_lights;
|
||||||
info.renderPass = ri.renderPass;
|
info.renderPass = ri.renderPass;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kAdditive;
|
info.rasterMode = RasterMode::kAdditive;
|
||||||
info.modelFormat = sphereModel->getModelFormat();
|
info.modelFormat = sphereModel->getModelFormat();
|
||||||
info.vertexAttributes = sphereModel->getVertexAttributes();
|
info.vertexAttributes = sphereModel->getVertexAttributes();
|
||||||
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRAMBIENT_ZONE_H
|
#pragma once
|
||||||
#define KRAMBIENT_ZONE_H
|
|
||||||
|
|
||||||
#include "KRResource.h"
|
#include "KRResource.h"
|
||||||
#include "KRNode.h"
|
#include "KRNode.h"
|
||||||
@@ -72,6 +71,3 @@ private:
|
|||||||
std::string m_ambient;
|
std::string m_ambient;
|
||||||
float m_ambient_gain;
|
float m_ambient_gain;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRANIMATION_H
|
#pragma once
|
||||||
#define KRANIMATION_H
|
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
#include "KRContextObject.h"
|
#include "KRContextObject.h"
|
||||||
@@ -83,7 +82,3 @@ private:
|
|||||||
float m_duration;
|
float m_duration;
|
||||||
float m_start_time;
|
float m_start_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRANIMATIONATTRIBUTE_H
|
#pragma once
|
||||||
#define KRANIMATIONATTRIBUTE_H
|
|
||||||
|
|
||||||
#include "KRContextObject.h"
|
#include "KRContextObject.h"
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
@@ -67,5 +66,3 @@ private:
|
|||||||
KRNode *m_target;
|
KRNode *m_target;
|
||||||
KRAnimationCurve *m_curve;
|
KRAnimationCurve *m_curve;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRANIMATIONCURVE_H
|
#pragma once
|
||||||
#define KRANIMATIONCURVE_H
|
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
#include "KRContextObject.h"
|
#include "KRContextObject.h"
|
||||||
@@ -82,5 +81,3 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRANIMATIONCURVEMANAGER_H
|
#pragma once
|
||||||
#define KRANIMATIONCURVEMANAGER_H
|
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
|
|
||||||
@@ -61,6 +60,3 @@ private:
|
|||||||
unordered_map<std::string, KRAnimationCurve *> m_animationCurves;
|
unordered_map<std::string, KRAnimationCurve *> m_animationCurves;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRANIMATIONLAYER_H
|
#pragma once
|
||||||
#define KRANIMATIONLAYER_H
|
|
||||||
|
|
||||||
#include "KRContextObject.h"
|
#include "KRContextObject.h"
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
@@ -92,5 +91,3 @@ private:
|
|||||||
|
|
||||||
std::vector<KRAnimationAttribute *> m_attributes;
|
std::vector<KRAnimationAttribute *> m_attributes;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRANIMATIONMANAGER_H
|
#pragma once
|
||||||
#define KRANIMATIONMANAGER_H
|
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
|
|
||||||
@@ -67,6 +66,3 @@ private:
|
|||||||
set<KRAnimation *> m_animationsToUpdate;
|
set<KRAnimation *> m_animationsToUpdate;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRAUDIO_BUFFER_H
|
#pragma once
|
||||||
#define KRAUDIO_BUFFER_H
|
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
#include "KRDataBlock.h"
|
#include "KRDataBlock.h"
|
||||||
@@ -61,5 +60,3 @@ private:
|
|||||||
|
|
||||||
KRAudioSample *m_audioSample;
|
KRAudioSample *m_audioSample;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(KRAUDIO_BUFFER_H) */
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRAUDIO_MANAGER_H
|
#pragma once
|
||||||
#define KRAUDIO_MANAGER_H
|
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
|
|
||||||
@@ -254,5 +253,3 @@ private:
|
|||||||
bool m_anticlick_block;
|
bool m_anticlick_block;
|
||||||
bool m_high_quality_hrtf; // If true, 4 HRTF samples will be interpolated; if false, the nearest HRTF sample will be used without interpolation
|
bool m_high_quality_hrtf; // If true, 4 HRTF samples will be interpolated; if false, the nearest HRTF sample will be used without interpolation
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(KRAUDIO_MANAGER_H) */
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRAUDIOSAMPLE_H
|
#pragma once
|
||||||
#define KRAUDIOSAMPLE_H
|
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
#include "KRContextObject.h"
|
#include "KRContextObject.h"
|
||||||
@@ -109,5 +108,3 @@ private:
|
|||||||
|
|
||||||
static void PopulateBuffer(KRAudioSample *sound, int index, void *data);
|
static void PopulateBuffer(KRAudioSample *sound, int index, void *data);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(KRAUDIOSAMPLE_H) */
|
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ void KRAudioSource::render(RenderInfo& ri)
|
|||||||
info.directional_lights = &ri.directional_lights;
|
info.directional_lights = &ri.directional_lights;
|
||||||
info.spot_lights = &ri.spot_lights;
|
info.spot_lights = &ri.spot_lights;
|
||||||
info.renderPass = ri.renderPass;
|
info.renderPass = ri.renderPass;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kAdditive;
|
info.rasterMode = RasterMode::kAdditive;
|
||||||
info.modelFormat = sphereModel->getModelFormat();
|
info.modelFormat = sphereModel->getModelFormat();
|
||||||
info.vertexAttributes = sphereModel->getVertexAttributes();
|
info.vertexAttributes = sphereModel->getVertexAttributes();
|
||||||
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRAUDIOSOURCE_H
|
#pragma once
|
||||||
#define KRAUDIOSOURCE_H
|
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
#include "KRResource.h"
|
#include "KRResource.h"
|
||||||
@@ -156,5 +155,3 @@ private:
|
|||||||
bool m_enable_occlusion;
|
bool m_enable_occlusion;
|
||||||
bool m_enable_obstruction;
|
bool m_enable_obstruction;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(KRAUDIOSOURCE_H) */
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRBEHAVIOR_H
|
#pragma once
|
||||||
#define KRBEHAVIOR_H
|
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -69,5 +68,3 @@ public:
|
|||||||
private:
|
private:
|
||||||
KRNode *__node;
|
KRNode *__node;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(KRBEHAVIOR_H) */
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ void KRBone::render(RenderInfo& ri)
|
|||||||
info.directional_lights = &ri.directional_lights;
|
info.directional_lights = &ri.directional_lights;
|
||||||
info.spot_lights = &ri.spot_lights;
|
info.spot_lights = &ri.spot_lights;
|
||||||
info.renderPass = ri.renderPass;
|
info.renderPass = ri.renderPass;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kAdditiveNoTest;
|
info.rasterMode = RasterMode::kAdditiveNoTest;
|
||||||
info.modelFormat = sphereModel->getModelFormat();
|
info.modelFormat = sphereModel->getModelFormat();
|
||||||
info.vertexAttributes = sphereModel->getVertexAttributes();
|
info.vertexAttributes = sphereModel->getVertexAttributes();
|
||||||
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRBONE_H
|
#pragma once
|
||||||
#define KRBONE_H
|
|
||||||
|
|
||||||
#include "KRResource.h"
|
#include "KRResource.h"
|
||||||
#include "KRNode.h"
|
#include "KRNode.h"
|
||||||
@@ -56,6 +55,3 @@ public:
|
|||||||
private:
|
private:
|
||||||
Matrix4 m_bind_pose;
|
Matrix4 m_bind_pose;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -28,8 +28,7 @@
|
|||||||
// authors and should not be interpreted as representing official policies, either expressed
|
// authors and should not be interpreted as representing official policies, either expressed
|
||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
#ifndef KRBUNDLE_H
|
#pragma once
|
||||||
#define KRBUNDLE_H
|
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
#include "KRResource.h"
|
#include "KRResource.h"
|
||||||
@@ -50,5 +49,3 @@ private:
|
|||||||
KRDataBlock *m_pData;
|
KRDataBlock *m_pData;
|
||||||
static size_t RoundUpSize(size_t s);
|
static size_t RoundUpSize(size_t s);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(KRBUNDLE_H) */
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRBUNDLEMANAGER_H
|
#pragma once
|
||||||
#define KRBUNDLEMANAGER_H
|
|
||||||
|
|
||||||
#include "KRResourceManager.h"
|
#include "KRResourceManager.h"
|
||||||
|
|
||||||
@@ -59,5 +58,3 @@ public:
|
|||||||
private:
|
private:
|
||||||
unordered_map<std::string, KRBundle *> m_bundles;
|
unordered_map<std::string, KRBundle *> m_bundles;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(KRBUNDLEMANAGER_H) */
|
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ void KRCamera::renderFrame(VkCommandBuffer& commandBuffer, KRSurface& compositeS
|
|||||||
info.shader_name = &shader_name;
|
info.shader_name = &shader_name;
|
||||||
info.pCamera = this;
|
info.pCamera = this;
|
||||||
info.renderPass = KRNode::RENDER_PASS_FORWARD_TRANSPARENT;
|
info.renderPass = KRNode::RENDER_PASS_FORWARD_TRANSPARENT;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kAlphaBlend;
|
info.rasterMode = RasterMode::kAlphaBlend;
|
||||||
info.vertexAttributes = sphereMesh->getVertexAttributes();
|
info.vertexAttributes = sphereMesh->getVertexAttributes();
|
||||||
info.modelFormat = sphereMesh->getModelFormat();
|
info.modelFormat = sphereMesh->getModelFormat();
|
||||||
KRPipeline* testPipeline = m_pContext->getPipelineManager()->getPipeline(compositeSurface, info);
|
KRPipeline* testPipeline = m_pContext->getPipelineManager()->getPipeline(compositeSurface, info);
|
||||||
@@ -256,8 +256,8 @@ void KRCamera::renderFrame(VkCommandBuffer& commandBuffer, KRSurface& compositeS
|
|||||||
info.shader_name = &shader_name;
|
info.shader_name = &shader_name;
|
||||||
info.pCamera = this;
|
info.pCamera = this;
|
||||||
info.renderPass = KRNode::RENDER_PASS_FORWARD_OPAQUE;
|
info.renderPass = KRNode::RENDER_PASS_FORWARD_OPAQUE;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kOpaqueNoDepthWrite;
|
info.rasterMode = RasterMode::kOpaqueNoDepthWrite;
|
||||||
info.cullMode = PipelineInfo::CullMode::kCullNone;
|
info.cullMode = CullMode::kCullNone;
|
||||||
|
|
||||||
KRPipeline* pPipeline = getContext().getPipelineManager()->getPipeline(compositeSurface, info);
|
KRPipeline* pPipeline = getContext().getPipelineManager()->getPipeline(compositeSurface, info);
|
||||||
pPipeline->bind(commandBuffer, *this, m_viewport, Matrix4(), nullptr, nullptr, nullptr, KRNode::RENDER_PASS_FORWARD_OPAQUE, Vector3::Zero(), 0.0f, Vector4::Zero());
|
pPipeline->bind(commandBuffer, *this, m_viewport, Matrix4(), nullptr, nullptr, nullptr, KRNode::RENDER_PASS_FORWARD_OPAQUE, Vector3::Zero(), 0.0f, Vector4::Zero());
|
||||||
@@ -344,9 +344,9 @@ void KRCamera::renderFrame(VkCommandBuffer& commandBuffer, KRSurface& compositeS
|
|||||||
info.shader_name = &shader_name;
|
info.shader_name = &shader_name;
|
||||||
info.pCamera = this;
|
info.pCamera = this;
|
||||||
info.renderPass = KRNode::RENDER_PASS_FORWARD_TRANSPARENT;
|
info.renderPass = KRNode::RENDER_PASS_FORWARD_TRANSPARENT;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kAdditive;
|
info.rasterMode = RasterMode::kAdditive;
|
||||||
info.vertexAttributes = vertices.getVertexAttributes();
|
info.vertexAttributes = vertices.getVertexAttributes();
|
||||||
info.modelFormat = KRMesh::model_format_t::KRENGINE_MODEL_FORMAT_STRIP;
|
info.modelFormat = ModelFormat::KRENGINE_MODEL_FORMAT_STRIP;
|
||||||
KRPipeline *pVisShader = getContext().getPipelineManager()->getPipeline(compositeSurface, info);
|
KRPipeline *pVisShader = getContext().getPipelineManager()->getPipeline(compositeSurface, info);
|
||||||
|
|
||||||
m_pContext->getMeshManager()->bindVBO(commandBuffer, &vertices, 1.0f);
|
m_pContext->getMeshManager()->bindVBO(commandBuffer, &vertices, 1.0f);
|
||||||
@@ -566,8 +566,8 @@ void KRCamera::renderPost(VkCommandBuffer& commandBuffer, KRSurface& surface)
|
|||||||
info.shader_name = &shader_name;
|
info.shader_name = &shader_name;
|
||||||
info.pCamera = this;
|
info.pCamera = this;
|
||||||
info.renderPass = KRNode::RENDER_PASS_FORWARD_TRANSPARENT;
|
info.renderPass = KRNode::RENDER_PASS_FORWARD_TRANSPARENT;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kOpaqueNoTest;
|
info.rasterMode = RasterMode::kOpaqueNoTest;
|
||||||
info.modelFormat = KRMesh::model_format_t::KRENGINE_MODEL_FORMAT_STRIP;
|
info.modelFormat = ModelFormat::KRENGINE_MODEL_FORMAT_STRIP;
|
||||||
info.vertexAttributes = vertices.getVertexAttributes();
|
info.vertexAttributes = vertices.getVertexAttributes();
|
||||||
|
|
||||||
KRPipeline *postShader = m_pContext->getPipelineManager()->getPipeline(surface, info);
|
KRPipeline *postShader = m_pContext->getPipelineManager()->getPipeline(surface, info);
|
||||||
@@ -742,10 +742,10 @@ void KRCamera::renderPost(VkCommandBuffer& commandBuffer, KRSurface& surface)
|
|||||||
info.shader_name = &shader_name;
|
info.shader_name = &shader_name;
|
||||||
info.pCamera = this;
|
info.pCamera = this;
|
||||||
info.renderPass = KRNode::RENDER_PASS_FORWARD_TRANSPARENT;
|
info.renderPass = KRNode::RENDER_PASS_FORWARD_TRANSPARENT;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kAlphaBlendNoTest;
|
info.rasterMode = RasterMode::kAlphaBlendNoTest;
|
||||||
info.cullMode = PipelineInfo::CullMode::kCullNone;
|
info.cullMode = CullMode::kCullNone;
|
||||||
info.vertexAttributes = (1 << KRMesh::KRENGINE_ATTRIB_VERTEX) | (1 << KRMesh::KRENGINE_ATTRIB_TEXUVA);
|
info.vertexAttributes = (1 << KRMesh::KRENGINE_ATTRIB_VERTEX) | (1 << KRMesh::KRENGINE_ATTRIB_TEXUVA);
|
||||||
info.modelFormat = KRMesh::model_format_t::KRENGINE_MODEL_FORMAT_TRIANGLES;
|
info.modelFormat = ModelFormat::KRENGINE_MODEL_FORMAT_TRIANGLES;
|
||||||
KRPipeline *fontShader = m_pContext->getPipelineManager()->getPipeline(surface, info);
|
KRPipeline *fontShader = m_pContext->getPipelineManager()->getPipeline(surface, info);
|
||||||
fontShader->bind(commandBuffer, *this, m_viewport, Matrix4(), nullptr, nullptr, nullptr, KRNode::RENDER_PASS_FORWARD_TRANSPARENT, Vector3::Zero(), 0.0f, Vector4::Zero());
|
fontShader->bind(commandBuffer, *this, m_viewport, Matrix4(), nullptr, nullptr, nullptr, KRNode::RENDER_PASS_FORWARD_TRANSPARENT, Vector3::Zero(), 0.0f, Vector4::Zero());
|
||||||
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRCAMERA_H
|
#pragma once
|
||||||
#define KRCAMERA_H
|
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
|
|
||||||
@@ -118,5 +117,3 @@ private:
|
|||||||
int m_frame_times[KRAKEN_FPS_AVERAGE_FRAME_COUNT];
|
int m_frame_times[KRAKEN_FPS_AVERAGE_FRAME_COUNT];
|
||||||
int m_frame_times_filled;
|
int m_frame_times_filled;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ void KRCollider::render(RenderInfo& ri)
|
|||||||
info.directional_lights = &ri.directional_lights;
|
info.directional_lights = &ri.directional_lights;
|
||||||
info.spot_lights = &ri.spot_lights;
|
info.spot_lights = &ri.spot_lights;
|
||||||
info.renderPass = ri.renderPass;
|
info.renderPass = ri.renderPass;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kAdditive;
|
info.rasterMode = RasterMode::kAdditive;
|
||||||
info.modelFormat = m_model->getModelFormat();
|
info.modelFormat = m_model->getModelFormat();
|
||||||
info.vertexAttributes = m_model->getVertexAttributes();
|
info.vertexAttributes = m_model->getVertexAttributes();
|
||||||
|
|
||||||
|
|||||||
@@ -29,10 +29,10 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
|
|
||||||
#ifndef KRCOLLIDER_H
|
|
||||||
#define KRCOLLIDER_H
|
|
||||||
|
|
||||||
#define KRAKEN_COLLIDER_PHYSICS 1
|
#define KRAKEN_COLLIDER_PHYSICS 1
|
||||||
#define KRAKEN_COLLIDER_AUDIO 2
|
#define KRAKEN_COLLIDER_AUDIO 2
|
||||||
@@ -80,5 +80,3 @@ private:
|
|||||||
|
|
||||||
void loadModel();
|
void loadModel();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(KRCOLLIDER_H) */
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KREngine_KRContext_h
|
#pragma once
|
||||||
#define KREngine_KRContext_h
|
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
#include "KRBundleManager.h"
|
#include "KRBundleManager.h"
|
||||||
@@ -52,6 +51,7 @@
|
|||||||
class KRAudioManager;
|
class KRAudioManager;
|
||||||
class KRPresentationThread;
|
class KRPresentationThread;
|
||||||
class KRStreamerThread;
|
class KRStreamerThread;
|
||||||
|
class KRDeviceManager;
|
||||||
|
|
||||||
class KRContext {
|
class KRContext {
|
||||||
public:
|
public:
|
||||||
@@ -203,5 +203,3 @@ private:
|
|||||||
|
|
||||||
unordered_map<KrSurfaceMapIndex, KrSurfaceHandle> m_surfaceHandleMap;
|
unordered_map<KrSurfaceMapIndex, KrSurfaceHandle> m_surfaceHandleMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRCONTEXTOBJECT_H
|
#pragma once
|
||||||
#define KRCONTEXTOBJECT_H
|
|
||||||
|
|
||||||
class KRContext;
|
class KRContext;
|
||||||
|
|
||||||
@@ -44,5 +43,3 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
KRContext *m_pContext;
|
KRContext *m_pContext;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef _KRDSP_H
|
#pragma once
|
||||||
#define _KRDSP_H
|
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
|
|
||||||
@@ -90,5 +89,3 @@ void Accumulate(SplitComplex *buffer, const SplitComplex *buffer2, size_t count)
|
|||||||
void Multiply(const SplitComplex *a, const SplitComplex *b, SplitComplex *c, size_t count);
|
void Multiply(const SplitComplex *a, const SplitComplex *b, SplitComplex *c, size_t count);
|
||||||
|
|
||||||
} // namespace KRDSP
|
} // namespace KRDSP
|
||||||
|
|
||||||
#endif // _KRDSP_H
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KREngine_KRDataBlock_h
|
#pragma once
|
||||||
#define KREngine_KRDataBlock_h
|
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
|
|
||||||
@@ -127,5 +126,3 @@ private:
|
|||||||
void assertLocked();
|
void assertLocked();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -32,8 +32,7 @@
|
|||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
#include "KRContextObject.h"
|
#include "KRContextObject.h"
|
||||||
|
|
||||||
#ifndef KRDEVICE_H
|
#pragma once
|
||||||
#define KRDEVICE_H
|
|
||||||
|
|
||||||
class KRDevice : public KRContextObject
|
class KRDevice : public KRContextObject
|
||||||
{
|
{
|
||||||
@@ -68,5 +67,3 @@ public:
|
|||||||
VmaAllocator m_allocator;
|
VmaAllocator m_allocator;
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // KRDEVICE_H
|
|
||||||
|
|||||||
@@ -29,14 +29,13 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
|
|
||||||
#include "KRContext.h"
|
#include "KRContext.h"
|
||||||
#include "KRDevice.h"
|
#include "KRDevice.h"
|
||||||
|
|
||||||
#ifndef KRDEVICEMANAGER_H
|
|
||||||
#define KRDEVICEMANAGER_H
|
|
||||||
|
|
||||||
class KRDeviceManager : KRContextObject
|
class KRDeviceManager : KRContextObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -61,5 +60,3 @@ private:
|
|||||||
VkInstance m_vulkanInstance;
|
VkInstance m_vulkanInstance;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // KRDEVICEMANAGER_H
|
|
||||||
|
|||||||
@@ -146,10 +146,10 @@ void KRDirectionalLight::render(RenderInfo& ri) {
|
|||||||
info.pCamera = ri.camera;
|
info.pCamera = ri.camera;
|
||||||
info.directional_lights = &this_light;
|
info.directional_lights = &this_light;
|
||||||
info.renderPass = ri.renderPass;
|
info.renderPass = ri.renderPass;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kAdditiveNoTest;
|
info.rasterMode = RasterMode::kAdditiveNoTest;
|
||||||
|
|
||||||
info.vertexAttributes = vertices.getVertexAttributes();
|
info.vertexAttributes = vertices.getVertexAttributes();
|
||||||
info.modelFormat = KRMesh::model_format_t::KRENGINE_MODEL_FORMAT_STRIP;
|
info.modelFormat = ModelFormat::KRENGINE_MODEL_FORMAT_STRIP;
|
||||||
|
|
||||||
KRPipeline *pShader = getContext().getPipelineManager()->getPipeline(*ri.surface, info);
|
KRPipeline *pShader = getContext().getPipelineManager()->getPipeline(*ri.surface, info);
|
||||||
pShader->setUniform(KRPipeline::KRENGINE_UNIFORM_LIGHT_DIRECTION_VIEW_SPACE, light_direction_view_space);
|
pShader->setUniform(KRPipeline::KRENGINE_UNIFORM_LIGHT_DIRECTION_VIEW_SPACE, light_direction_view_space);
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KREngine_KRDirectionalLight_h
|
#pragma once
|
||||||
#define KREngine_KRDirectionalLight_h
|
|
||||||
|
|
||||||
#include "KRLight.h"
|
#include "KRLight.h"
|
||||||
|
|
||||||
@@ -55,5 +54,3 @@ protected:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -29,9 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
#ifndef KRENGINE_COMMON_H
|
|
||||||
#define KRENGINE_COMMON_H
|
|
||||||
|
|
||||||
#define KRENGINE_MAX_GPU_COUNT 4
|
#define KRENGINE_MAX_GPU_COUNT 4
|
||||||
#define KRENGINE_DEBUG_GPU_LABELS 1
|
#define KRENGINE_DEBUG_GPU_LABELS 1
|
||||||
@@ -266,6 +264,4 @@ typedef int KrSurfaceHandle;
|
|||||||
|
|
||||||
#include "KRBehavior.h"
|
#include "KRBehavior.h"
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace kraken;
|
using namespace kraken;
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRHELPERS_H
|
#pragma once
|
||||||
#define KRHELPERS_H
|
|
||||||
|
|
||||||
#include "vector2.h"
|
#include "vector2.h"
|
||||||
#include "vector3.h"
|
#include "vector3.h"
|
||||||
@@ -65,4 +64,3 @@ namespace kraken {
|
|||||||
const Vector3 getXMLAttribute(const std::string &base_name, ::tinyxml2::XMLElement *e, const Vector3 &default_value);
|
const Vector3 getXMLAttribute(const std::string &base_name, ::tinyxml2::XMLElement *e, const Vector3 &default_value);
|
||||||
} // namespace kraken
|
} // namespace kraken
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRLODGROUP_H
|
#pragma once
|
||||||
#define KRLODGROUP_H
|
|
||||||
|
|
||||||
#include "KRResource.h"
|
#include "KRResource.h"
|
||||||
#include "KRNode.h"
|
#include "KRNode.h"
|
||||||
@@ -62,6 +61,3 @@ private:
|
|||||||
AABB m_reference; // Point of reference, used for distance calculation. Usually set to the bounding box center
|
AABB m_reference; // Point of reference, used for distance calculation. Usually set to the bounding box center
|
||||||
bool m_use_world_units;
|
bool m_use_world_units;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRLODSET_H
|
#pragma once
|
||||||
#define KRLODSET_H
|
|
||||||
|
|
||||||
#include "KRResource.h"
|
#include "KRResource.h"
|
||||||
#include "KRNode.h"
|
#include "KRNode.h"
|
||||||
@@ -52,6 +51,3 @@ public:
|
|||||||
|
|
||||||
virtual kraken_stream_level getStreamLevel(const KRViewport &viewport);
|
virtual kraken_stream_level getStreamLevel(const KRViewport &viewport);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -264,10 +264,10 @@ void KRLight::render(RenderInfo& ri) {
|
|||||||
info.directional_lights = &this_directional_light;
|
info.directional_lights = &this_directional_light;
|
||||||
info.spot_lights = &this_spot_light;
|
info.spot_lights = &this_spot_light;
|
||||||
info.renderPass = ri.renderPass;
|
info.renderPass = ri.renderPass;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kAdditive;
|
info.rasterMode = RasterMode::kAdditive;
|
||||||
info.cullMode = PipelineInfo::CullMode::kCullNone;
|
info.cullMode = CullMode::kCullNone;
|
||||||
info.vertexAttributes = (1 << KRMesh::KRENGINE_ATTRIB_VERTEX) | (1 << KRMesh::KRENGINE_ATTRIB_TEXUVA);
|
info.vertexAttributes = (1 << KRMesh::KRENGINE_ATTRIB_VERTEX) | (1 << KRMesh::KRENGINE_ATTRIB_TEXUVA);
|
||||||
info.modelFormat = KRMesh::model_format_t::KRENGINE_MODEL_FORMAT_TRIANGLES;
|
info.modelFormat = ModelFormat::KRENGINE_MODEL_FORMAT_TRIANGLES;
|
||||||
KRPipeline *pParticleShader = m_pContext->getPipelineManager()->getPipeline(*ri.surface, info);
|
KRPipeline *pParticleShader = m_pContext->getPipelineManager()->getPipeline(*ri.surface, info);
|
||||||
|
|
||||||
pParticleShader->setUniform(KRPipeline::KRENGINE_UNIFORM_LIGHT_COLOR, m_color * ri.camera->settings.dust_particle_intensity * m_dust_particle_intensity * m_intensity);
|
pParticleShader->setUniform(KRPipeline::KRENGINE_UNIFORM_LIGHT_COLOR, m_color * ri.camera->settings.dust_particle_intensity * m_dust_particle_intensity * m_intensity);
|
||||||
@@ -313,10 +313,10 @@ void KRLight::render(RenderInfo& ri) {
|
|||||||
info.directional_lights = &this_directional_light;
|
info.directional_lights = &this_directional_light;
|
||||||
info.spot_lights = &this_spot_light;
|
info.spot_lights = &this_spot_light;
|
||||||
info.renderPass = KRNode::RENDER_PASS_ADDITIVE_PARTICLES;
|
info.renderPass = KRNode::RENDER_PASS_ADDITIVE_PARTICLES;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kAdditive;
|
info.rasterMode = RasterMode::kAdditive;
|
||||||
info.cullMode = PipelineInfo::CullMode::kCullNone;
|
info.cullMode = CullMode::kCullNone;
|
||||||
info.vertexAttributes = (1 << KRMesh::KRENGINE_ATTRIB_VERTEX);
|
info.vertexAttributes = (1 << KRMesh::KRENGINE_ATTRIB_VERTEX);
|
||||||
info.modelFormat = KRMesh::model_format_t::KRENGINE_MODEL_FORMAT_TRIANGLES;
|
info.modelFormat = ModelFormat::KRENGINE_MODEL_FORMAT_TRIANGLES;
|
||||||
|
|
||||||
KRPipeline *pFogShader = m_pContext->getPipelineManager()->getPipeline(*ri.surface, info);
|
KRPipeline *pFogShader = m_pContext->getPipelineManager()->getPipeline(*ri.surface, info);
|
||||||
|
|
||||||
@@ -360,8 +360,8 @@ void KRLight::render(RenderInfo& ri) {
|
|||||||
info.directional_lights = &ri.directional_lights;
|
info.directional_lights = &ri.directional_lights;
|
||||||
info.spot_lights = &ri.spot_lights;
|
info.spot_lights = &ri.spot_lights;
|
||||||
info.renderPass = ri.renderPass;
|
info.renderPass = ri.renderPass;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kAdditive;
|
info.rasterMode = RasterMode::kAdditive;
|
||||||
info.cullMode = PipelineInfo::CullMode::kCullNone;
|
info.cullMode = CullMode::kCullNone;
|
||||||
info.modelFormat = sphereModel->getModelFormat();
|
info.modelFormat = sphereModel->getModelFormat();
|
||||||
info.vertexAttributes = sphereModel->getVertexAttributes();
|
info.vertexAttributes = sphereModel->getVertexAttributes();
|
||||||
|
|
||||||
@@ -413,10 +413,10 @@ void KRLight::render(RenderInfo& ri) {
|
|||||||
info.directional_lights = &ri.directional_lights;
|
info.directional_lights = &ri.directional_lights;
|
||||||
info.spot_lights = &ri.spot_lights;
|
info.spot_lights = &ri.spot_lights;
|
||||||
info.renderPass = ri.renderPass;
|
info.renderPass = ri.renderPass;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kAdditiveNoTest;
|
info.rasterMode = RasterMode::kAdditiveNoTest;
|
||||||
info.cullMode = PipelineInfo::CullMode::kCullNone;
|
info.cullMode = CullMode::kCullNone;
|
||||||
info.vertexAttributes = vertices.getVertexAttributes();
|
info.vertexAttributes = vertices.getVertexAttributes();
|
||||||
info.modelFormat = KRMesh::model_format_t::KRENGINE_MODEL_FORMAT_STRIP;
|
info.modelFormat = ModelFormat::KRENGINE_MODEL_FORMAT_STRIP;
|
||||||
|
|
||||||
|
|
||||||
KRPipeline *pShader = getContext().getPipelineManager()->getPipeline(*ri.surface, info);
|
KRPipeline *pShader = getContext().getPipelineManager()->getPipeline(*ri.surface, info);
|
||||||
@@ -528,8 +528,8 @@ void KRLight::renderShadowBuffers(RenderInfo& ri)
|
|||||||
info.shader_name = &shader_name;
|
info.shader_name = &shader_name;
|
||||||
info.pCamera = ri.camera;
|
info.pCamera = ri.camera;
|
||||||
info.renderPass = KRNode::RENDER_PASS_FORWARD_TRANSPARENT;
|
info.renderPass = KRNode::RENDER_PASS_FORWARD_TRANSPARENT;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kOpaqueLessTest; // TODO - This is sub-optimal. Evaluate increasing depth buffer resolution instead of disabling depth test.
|
info.rasterMode = RasterMode::kOpaqueLessTest; // TODO - This is sub-optimal. Evaluate increasing depth buffer resolution instead of disabling depth test.
|
||||||
info.cullMode = PipelineInfo::CullMode::kCullNone; // Disabling culling, which eliminates some self-cast shadow artifacts
|
info.cullMode = CullMode::kCullNone; // Disabling culling, which eliminates some self-cast shadow artifacts
|
||||||
KRPipeline *shadowShader = m_pContext->getPipelineManager()->getPipeline(*ri.surface, info);
|
KRPipeline *shadowShader = m_pContext->getPipelineManager()->getPipeline(*ri.surface, info);
|
||||||
|
|
||||||
shadowShader->bind(ri.commandBuffer, *ri.camera, m_shadowViewports[iShadow], Matrix4(), nullptr, nullptr, nullptr, KRNode::RENDER_PASS_SHADOWMAP, Vector3::Zero(), 0.0f, Vector4::Zero());
|
shadowShader->bind(ri.commandBuffer, *ri.camera, m_shadowViewports[iShadow], Matrix4(), nullptr, nullptr, nullptr, KRNode::RENDER_PASS_SHADOWMAP, Vector3::Zero(), 0.0f, Vector4::Zero());
|
||||||
|
|||||||
@@ -28,8 +28,7 @@
|
|||||||
// authors and should not be interpreted as representing official policies, either expressed
|
// authors and should not be interpreted as representing official policies, either expressed
|
||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
#ifndef KRLIGHT_H
|
#pragma once
|
||||||
#define KRLIGHT_H
|
|
||||||
|
|
||||||
#include "KRResource.h"
|
#include "KRResource.h"
|
||||||
#include "KRNode.h"
|
#include "KRNode.h"
|
||||||
@@ -104,5 +103,3 @@ protected:
|
|||||||
virtual int configureShadowBufferViewports(const KRViewport &viewport);
|
virtual int configureShadowBufferViewports(const KRViewport &viewport);
|
||||||
void renderShadowBuffers(RenderInfo& ri);
|
void renderShadowBuffers(RenderInfo& ri);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRLOCATOR_H
|
#pragma once
|
||||||
#define KRLOCATOR_H
|
|
||||||
|
|
||||||
#include "KRResource.h"
|
#include "KRResource.h"
|
||||||
#include "KRNode.h"
|
#include "KRNode.h"
|
||||||
@@ -56,6 +55,3 @@ private:
|
|||||||
unordered_map<std::string, bool> m_userBoolAttributes;
|
unordered_map<std::string, bool> m_userBoolAttributes;
|
||||||
unordered_map<std::string, std::string> m_userStringAttributes;
|
unordered_map<std::string, std::string> m_userStringAttributes;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -302,7 +302,7 @@ void KRMaterial::getTextures()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KRMaterial::bind(const KRNode::RenderInfo& ri, const std::vector<KRBone *> &bones, const std::vector<Matrix4> &bind_poses, const Matrix4 &matModel, KRTexture *pLightMap, const Vector3 &rim_color, float rim_power, float lod_coverage)
|
void KRMaterial::bind(const KRNode::RenderInfo& ri, ModelFormat modelFormat, __uint32_t vertexAttributes, CullMode cullMode, const std::vector<KRBone *> &bones, const std::vector<Matrix4> &bind_poses, const Matrix4 &matModel, KRTexture *pLightMap, const Vector3 &rim_color, float rim_power, float lod_coverage)
|
||||||
{
|
{
|
||||||
bool bLightMap = pLightMap && ri.camera->settings.bEnableLightMap;
|
bool bLightMap = pLightMap && ri.camera->settings.bEnableLightMap;
|
||||||
|
|
||||||
@@ -344,9 +344,12 @@ bool KRMaterial::bind(const KRNode::RenderInfo& ri, const std::vector<KRBone *>
|
|||||||
info.bNormalMapOffset = m_normalMapOffset != default_offset && bNormalMap;
|
info.bNormalMapOffset = m_normalMapOffset != default_offset && bNormalMap;
|
||||||
info.bReflectionMapOffset = m_reflectionMapOffset != default_offset && bReflectionMap;
|
info.bReflectionMapOffset = m_reflectionMapOffset != default_offset && bReflectionMap;
|
||||||
info.bAlphaTest = bAlphaTest;
|
info.bAlphaTest = bAlphaTest;
|
||||||
info.rasterMode = bAlphaBlend ? PipelineInfo::RasterMode::kAlphaBlend : PipelineInfo::RasterMode::kOpaque;
|
info.rasterMode = bAlphaBlend ? RasterMode::kAlphaBlend : RasterMode::kOpaque;
|
||||||
info.bRimColor = rim_power != 0.0f;
|
info.bRimColor = rim_power != 0.0f;
|
||||||
info.renderPass = ri.renderPass;
|
info.renderPass = ri.renderPass;
|
||||||
|
info.modelFormat = modelFormat;
|
||||||
|
info.vertexAttributes = vertexAttributes;
|
||||||
|
info.cullMode = cullMode;
|
||||||
KRPipeline *pShader = getContext().getPipelineManager()->getPipeline(*ri.surface, info);
|
KRPipeline *pShader = getContext().getPipelineManager()->getPipeline(*ri.surface, info);
|
||||||
|
|
||||||
// Bind bones
|
// Bind bones
|
||||||
@@ -434,8 +437,6 @@ bool KRMaterial::bind(const KRNode::RenderInfo& ri, const std::vector<KRBone *>
|
|||||||
}
|
}
|
||||||
|
|
||||||
pShader->bind(ri.commandBuffer, *ri.camera, ri.viewport, matModel, &ri.point_lights, &ri.directional_lights, &ri.spot_lights, ri.renderPass, rim_color, rim_power, Vector4::Zero());
|
pShader->bind(ri.commandBuffer, *ri.camera, ri.viewport, matModel, &ri.point_lights, &ri.directional_lights, &ri.spot_lights, ri.renderPass, rim_color, rim_power, Vector4::Zero());
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &KRMaterial::getName() const
|
const std::string &KRMaterial::getName() const
|
||||||
|
|||||||
@@ -29,6 +29,10 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
|
|
||||||
#include "KRTexture.h"
|
#include "KRTexture.h"
|
||||||
@@ -39,10 +43,8 @@
|
|||||||
#include "KRScene.h"
|
#include "KRScene.h"
|
||||||
#include "KRBone.h"
|
#include "KRBone.h"
|
||||||
|
|
||||||
#ifndef KRMATERIAL_H
|
enum class CullMode : __uint32_t;
|
||||||
#define KRMATERIAL_H
|
enum class ModelFormat : __uint8_t;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class KRTextureManager;
|
class KRTextureManager;
|
||||||
class KRContext;
|
class KRContext;
|
||||||
@@ -83,7 +85,7 @@ public:
|
|||||||
bool isTransparent();
|
bool isTransparent();
|
||||||
const std::string &getName() const;
|
const std::string &getName() const;
|
||||||
|
|
||||||
bool bind(const KRNode::RenderInfo& ri, const std::vector<KRBone*>& bones, const std::vector<Matrix4>& bind_poses, const Matrix4& matModel, KRTexture* pLightMap, const Vector3& rim_color, float rim_power, float lod_coverage = 0.0f);
|
void bind(const KRNode::RenderInfo& ri, ModelFormat modelFormat, __uint32_t vertexAttributes, CullMode cullMode, const std::vector<KRBone*>& bones, const std::vector<Matrix4>& bind_poses, const Matrix4& matModel, KRTexture* pLightMap, const Vector3& rim_color, float rim_power, float lod_coverage = 0.0f);
|
||||||
|
|
||||||
bool needsVertexTangents();
|
bool needsVertexTangents();
|
||||||
|
|
||||||
@@ -134,5 +136,3 @@ private:
|
|||||||
|
|
||||||
void getTextures();
|
void getTextures();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef KRMATERIALMANAGER_H
|
#pragma once
|
||||||
#define KRMATERIALMANAGER_H
|
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
|
|
||||||
@@ -40,6 +39,7 @@
|
|||||||
#include "KRTextureManager.h"
|
#include "KRTextureManager.h"
|
||||||
#include "KRMaterialManager.h"
|
#include "KRMaterialManager.h"
|
||||||
|
|
||||||
|
class KRMaterial;
|
||||||
|
|
||||||
using std::map;
|
using std::map;
|
||||||
|
|
||||||
@@ -63,6 +63,3 @@ private:
|
|||||||
KRPipelineManager *m_pPipelineManager;
|
KRPipelineManager *m_pPipelineManager;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|||||||
@@ -279,26 +279,27 @@ void KRMesh::render(const KRNode::RenderInfo& ri, const std::string& object_name
|
|||||||
for(int i=0; i < (int)bones.size(); i++) {
|
for(int i=0; i < (int)bones.size(); i++) {
|
||||||
bone_bind_poses.push_back(getBoneBindPose(i));
|
bone_bind_poses.push_back(getBoneBindPose(i));
|
||||||
}
|
}
|
||||||
if(pMaterial->bind(ri, bones, bone_bind_poses, matModel, pLightMap, rim_color, rim_power, lod_coverage)) {
|
|
||||||
|
|
||||||
switch(pMaterial->getAlphaMode()) {
|
|
||||||
case KRMaterial::KRMATERIAL_ALPHA_MODE_OPAQUE: // Non-transparent materials
|
|
||||||
case KRMaterial::KRMATERIAL_ALPHA_MODE_TEST: // Alpha in diffuse texture is interpreted as punch-through when < 0.5
|
|
||||||
renderSubmesh(ri.commandBuffer, iSubmesh, ri.renderPass, object_name, pMaterial->getName(), lod_coverage);
|
|
||||||
break;
|
|
||||||
case KRMaterial::KRMATERIAL_ALPHA_MODE_BLENDONESIDE: // Blended alpha with backface culling
|
|
||||||
renderSubmesh(ri.commandBuffer, iSubmesh, ri.renderPass, object_name, pMaterial->getName(), lod_coverage);
|
|
||||||
break;
|
|
||||||
case KRMaterial::KRMATERIAL_ALPHA_MODE_BLENDTWOSIDE: // Blended alpha rendered in two passes. First pass renders backfaces; second pass renders frontfaces.
|
|
||||||
// Render back faces first
|
|
||||||
GLDEBUG(glCullFace(GL_FRONT));
|
|
||||||
renderSubmesh(ri.commandBuffer, iSubmesh, ri.renderPass, object_name, pMaterial->getName(), lod_coverage);
|
|
||||||
|
|
||||||
// Render front faces second
|
switch(pMaterial->getAlphaMode()) {
|
||||||
GLDEBUG(glCullFace(GL_BACK));
|
case KRMaterial::KRMATERIAL_ALPHA_MODE_OPAQUE: // Non-transparent materials
|
||||||
renderSubmesh(ri.commandBuffer, iSubmesh, ri.renderPass, object_name, pMaterial->getName(), lod_coverage);
|
case KRMaterial::KRMATERIAL_ALPHA_MODE_TEST: // Alpha in diffuse texture is interpreted as punch-through when < 0.5
|
||||||
break;
|
pMaterial->bind(ri, getModelFormat(), getVertexAttributes(), CullMode::kCullBack, bones, bone_bind_poses, matModel, pLightMap, rim_color, rim_power, lod_coverage);
|
||||||
}
|
renderSubmesh(ri.commandBuffer, iSubmesh, ri.renderPass, object_name, pMaterial->getName(), lod_coverage);
|
||||||
|
break;
|
||||||
|
case KRMaterial::KRMATERIAL_ALPHA_MODE_BLENDONESIDE: // Blended alpha with backface culling
|
||||||
|
pMaterial->bind(ri, getModelFormat(), getVertexAttributes(), CullMode::kCullBack, bones, bone_bind_poses, matModel, pLightMap, rim_color, rim_power, lod_coverage);
|
||||||
|
renderSubmesh(ri.commandBuffer, iSubmesh, ri.renderPass, object_name, pMaterial->getName(), lod_coverage);
|
||||||
|
break;
|
||||||
|
case KRMaterial::KRMATERIAL_ALPHA_MODE_BLENDTWOSIDE: // Blended alpha rendered in two passes. First pass renders backfaces; second pass renders frontfaces.
|
||||||
|
// Render back faces first
|
||||||
|
pMaterial->bind(ri, getModelFormat(), getVertexAttributes(), CullMode::kCullFront, bones, bone_bind_poses, matModel, pLightMap, rim_color, rim_power, lod_coverage);
|
||||||
|
renderSubmesh(ri.commandBuffer, iSubmesh, ri.renderPass, object_name, pMaterial->getName(), lod_coverage);
|
||||||
|
|
||||||
|
// Render front faces second
|
||||||
|
pMaterial->bind(ri, getModelFormat(), getVertexAttributes(), CullMode::kCullBack, bones, bone_bind_poses, matModel, pLightMap, rim_color, rim_power, lod_coverage);
|
||||||
|
renderSubmesh(ri.commandBuffer, iSubmesh, ri.renderPass, object_name, pMaterial->getName(), lod_coverage);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -357,7 +358,7 @@ void KRMesh::createDataBlocks(KRMeshManager::KRVBOData::vbo_type t)
|
|||||||
int32_t vertex_count = pHeader->vertex_count;
|
int32_t vertex_count = pHeader->vertex_count;
|
||||||
|
|
||||||
int vbo_index=0;
|
int vbo_index=0;
|
||||||
if(getModelFormat() == KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES) {
|
if(getModelFormat() == ModelFormat::KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES) {
|
||||||
|
|
||||||
int index_group = getSubmesh(iSubmesh)->index_group;
|
int index_group = getSubmesh(iSubmesh)->index_group;
|
||||||
int index_group_offset = getSubmesh(iSubmesh)->index_group_offset;
|
int index_group_offset = getSubmesh(iSubmesh)->index_group_offset;
|
||||||
@@ -457,7 +458,7 @@ void KRMesh::renderSubmesh(VkCommandBuffer& commandBuffer, int iSubmesh, KRNode:
|
|||||||
int cVertexes = pSubmesh->vertex_count;
|
int cVertexes = pSubmesh->vertex_count;
|
||||||
|
|
||||||
int vbo_index=0;
|
int vbo_index=0;
|
||||||
if(getModelFormat() == KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES) {
|
if(getModelFormat() == ModelFormat::KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES) {
|
||||||
|
|
||||||
int index_group = getSubmesh(iSubmesh)->index_group;
|
int index_group = getSubmesh(iSubmesh)->index_group;
|
||||||
int index_group_offset = getSubmesh(iSubmesh)->index_group_offset;
|
int index_group_offset = getSubmesh(iSubmesh)->index_group_offset;
|
||||||
@@ -497,12 +498,12 @@ void KRMesh::renderSubmesh(VkCommandBuffer& commandBuffer, int iSubmesh, KRNode:
|
|||||||
if(iVertex + cVertexes >= MAX_VBO_SIZE) {
|
if(iVertex + cVertexes >= MAX_VBO_SIZE) {
|
||||||
assert(iVertex + (MAX_VBO_SIZE - iVertex) <= cBufferVertexes);
|
assert(iVertex + (MAX_VBO_SIZE - iVertex) <= cBufferVertexes);
|
||||||
switch (getModelFormat()) {
|
switch (getModelFormat()) {
|
||||||
case KRENGINE_MODEL_FORMAT_TRIANGLES:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_TRIANGLES:
|
||||||
case KRENGINE_MODEL_FORMAT_STRIP:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_STRIP:
|
||||||
vkCmdDraw(commandBuffer, (MAX_VBO_SIZE - iVertex), 1, iVertex, 0);
|
vkCmdDraw(commandBuffer, (MAX_VBO_SIZE - iVertex), 1, iVertex, 0);
|
||||||
break;
|
break;
|
||||||
case KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES:
|
||||||
case KRENGINE_MODEL_FORMAT_INDEXED_STRIP:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_INDEXED_STRIP:
|
||||||
vkCmdDrawIndexed(commandBuffer, (MAX_VBO_SIZE - iVertex), 1, iVertex, 0, 0);
|
vkCmdDrawIndexed(commandBuffer, (MAX_VBO_SIZE - iVertex), 1, iVertex, 0, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -515,10 +516,10 @@ void KRMesh::renderSubmesh(VkCommandBuffer& commandBuffer, int iSubmesh, KRNode:
|
|||||||
assert(iVertex + cVertexes <= cBufferVertexes);
|
assert(iVertex + cVertexes <= cBufferVertexes);
|
||||||
|
|
||||||
switch (getModelFormat()) {
|
switch (getModelFormat()) {
|
||||||
case KRENGINE_MODEL_FORMAT_TRIANGLES:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_TRIANGLES:
|
||||||
GLDEBUG(glDrawArrays(GL_TRIANGLES, iVertex, cVertexes));
|
GLDEBUG(glDrawArrays(GL_TRIANGLES, iVertex, cVertexes));
|
||||||
break;
|
break;
|
||||||
case KRENGINE_MODEL_FORMAT_STRIP:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_STRIP:
|
||||||
GLDEBUG(glDrawArrays(GL_TRIANGLE_STRIP, iVertex, cVertexes));
|
GLDEBUG(glDrawArrays(GL_TRIANGLE_STRIP, iVertex, cVertexes));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -626,7 +627,7 @@ void KRMesh::LoadData(const KRMesh::mesh_info &mi, bool calculate_normals, bool
|
|||||||
pHeader->bone_count = (__int32_t)bone_count;
|
pHeader->bone_count = (__int32_t)bone_count;
|
||||||
pHeader->index_count = (__int32_t)index_count;
|
pHeader->index_count = (__int32_t)index_count;
|
||||||
pHeader->index_base_count = (__int32_t)index_base_count;
|
pHeader->index_base_count = (__int32_t)index_base_count;
|
||||||
pHeader->model_format = mi.format;
|
pHeader->model_format = (__int32_t)mi.format;
|
||||||
strcpy(pHeader->szTag, "KROBJPACK1.2 ");
|
strcpy(pHeader->szTag, "KROBJPACK1.2 ");
|
||||||
updateAttributeOffsets();
|
updateAttributeOffsets();
|
||||||
|
|
||||||
@@ -704,7 +705,7 @@ void KRMesh::LoadData(const KRMesh::mesh_info &mi, bool calculate_normals, bool
|
|||||||
*index_base_data++ = (*itr).second;
|
*index_base_data++ = (*itr).second;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getModelFormat() == KRENGINE_MODEL_FORMAT_TRIANGLES) {
|
if(getModelFormat() == ModelFormat::KRENGINE_MODEL_FORMAT_TRIANGLES) {
|
||||||
// Calculate missing surface normals and tangents
|
// Calculate missing surface normals and tangents
|
||||||
//cout << " Calculate surface normals and tangents\n";
|
//cout << " Calculate surface normals and tangents\n";
|
||||||
if(calculate_normals || calculate_tangents) {
|
if(calculate_normals || calculate_tangents) {
|
||||||
@@ -1147,9 +1148,9 @@ Matrix4 KRMesh::getBoneBindPose(int bone_index)
|
|||||||
return Matrix4::Create(getBone(bone_index)->bind_pose);
|
return Matrix4::Create(getBone(bone_index)->bind_pose);
|
||||||
}
|
}
|
||||||
|
|
||||||
KRMesh::model_format_t KRMesh::getModelFormat() const
|
ModelFormat KRMesh::getModelFormat() const
|
||||||
{
|
{
|
||||||
model_format_t f = (model_format_t)getHeader()->model_format;
|
ModelFormat f = (ModelFormat)getHeader()->model_format;
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1195,8 +1196,8 @@ bool KRMesh::rayCast(const Vector3 &start, const Vector3 &dir, HitInfo &hitinfo)
|
|||||||
// int vertex_start = getSubmesh(submesh_index)->start_vertex;
|
// int vertex_start = getSubmesh(submesh_index)->start_vertex;
|
||||||
int vertex_count = getVertexCount(submesh_index);
|
int vertex_count = getVertexCount(submesh_index);
|
||||||
switch(getModelFormat()) {
|
switch(getModelFormat()) {
|
||||||
case KRENGINE_MODEL_FORMAT_TRIANGLES:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_TRIANGLES:
|
||||||
case KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES:
|
||||||
for(int triangle_index=0; triangle_index < vertex_count / 3; triangle_index++) {
|
for(int triangle_index=0; triangle_index < vertex_count / 3; triangle_index++) {
|
||||||
int tri_vert_index[3]; // FINDME, HACK! This is not very efficient for indexed collider meshes...
|
int tri_vert_index[3]; // FINDME, HACK! This is not very efficient for indexed collider meshes...
|
||||||
tri_vert_index[0] = getTriangleVertexIndex(submesh_index, triangle_index*3);
|
tri_vert_index[0] = getTriangleVertexIndex(submesh_index, triangle_index*3);
|
||||||
@@ -1212,8 +1213,8 @@ bool KRMesh::rayCast(const Vector3 &start, const Vector3 &dir, HitInfo &hitinfo)
|
|||||||
|
|
||||||
NOTE: Not yet supported:
|
NOTE: Not yet supported:
|
||||||
|
|
||||||
case KRENGINE_MODEL_FORMAT_STRIP:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_STRIP:
|
||||||
case KRENGINE_MODEL_FORMAT_INDEXED_STRIP:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_INDEXED_STRIP:
|
||||||
for(int triangle_index=0; triangle_index < vertex_count - 2; triangle_index++) {
|
for(int triangle_index=0; triangle_index < vertex_count - 2; triangle_index++) {
|
||||||
int tri_vert_index[3];
|
int tri_vert_index[3];
|
||||||
tri_vert_index[0] = getTriangleVertexIndex(submesh_index, vertex_start + triangle_index*3);
|
tri_vert_index[0] = getTriangleVertexIndex(submesh_index, vertex_start + triangle_index*3);
|
||||||
@@ -1241,8 +1242,8 @@ bool KRMesh::sphereCast(const Matrix4 &model_to_world, const Vector3 &v0, const
|
|||||||
for(int submesh_index=0; submesh_index < getSubmeshCount(); submesh_index++) {
|
for(int submesh_index=0; submesh_index < getSubmeshCount(); submesh_index++) {
|
||||||
int vertex_count = getVertexCount(submesh_index);
|
int vertex_count = getVertexCount(submesh_index);
|
||||||
switch(getModelFormat()) {
|
switch(getModelFormat()) {
|
||||||
case KRENGINE_MODEL_FORMAT_TRIANGLES:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_TRIANGLES:
|
||||||
case KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES:
|
||||||
for(int triangle_index=0; triangle_index < vertex_count / 3; triangle_index++) {
|
for(int triangle_index=0; triangle_index < vertex_count / 3; triangle_index++) {
|
||||||
int tri_vert_index[3]; // FINDME, HACK! This is not very efficient for indexed collider meshes...
|
int tri_vert_index[3]; // FINDME, HACK! This is not very efficient for indexed collider meshes...
|
||||||
tri_vert_index[0] = getTriangleVertexIndex(submesh_index, triangle_index*3);
|
tri_vert_index[0] = getTriangleVertexIndex(submesh_index, triangle_index*3);
|
||||||
@@ -1264,8 +1265,8 @@ bool KRMesh::sphereCast(const Matrix4 &model_to_world, const Vector3 &v0, const
|
|||||||
|
|
||||||
NOTE: Not yet supported:
|
NOTE: Not yet supported:
|
||||||
|
|
||||||
case KRENGINE_MODEL_FORMAT_STRIP:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_STRIP:
|
||||||
case KRENGINE_MODEL_FORMAT_INDEXED_STRIP:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_INDEXED_STRIP:
|
||||||
for(int triangle_index=0; triangle_index < vertex_count - 2; triangle_index++) {
|
for(int triangle_index=0; triangle_index < vertex_count - 2; triangle_index++) {
|
||||||
int tri_vert_index[3];
|
int tri_vert_index[3];
|
||||||
tri_vert_index[0] = getTriangleVertexIndex(submesh_index, vertex_start + triangle_index*3);
|
tri_vert_index[0] = getTriangleVertexIndex(submesh_index, vertex_start + triangle_index*3);
|
||||||
@@ -1511,7 +1512,7 @@ void KRMesh::convertToIndexed()
|
|||||||
KRContext::Log(KRContext::LOG_LEVEL_INFORMATION, "Convert to indexed, before: %i after: %i (%.2f%% saving)", getHeader()->vertex_count, mi.vertices.size(), ((float)getHeader()->vertex_count - (float)mi.vertices.size()) / (float)getHeader()->vertex_count * 100.0f);
|
KRContext::Log(KRContext::LOG_LEVEL_INFORMATION, "Convert to indexed, before: %i after: %i (%.2f%% saving)", getHeader()->vertex_count, mi.vertices.size(), ((float)getHeader()->vertex_count - (float)mi.vertices.size()) / (float)getHeader()->vertex_count * 100.0f);
|
||||||
|
|
||||||
|
|
||||||
mi.format = KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES;
|
mi.format = ModelFormat::KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES;
|
||||||
|
|
||||||
m_pData->unlock();
|
m_pData->unlock();
|
||||||
LoadData(mi, false, false);
|
LoadData(mi, false, false);
|
||||||
@@ -1520,7 +1521,7 @@ void KRMesh::convertToIndexed()
|
|||||||
void KRMesh::optimize()
|
void KRMesh::optimize()
|
||||||
{
|
{
|
||||||
switch(getModelFormat()) {
|
switch(getModelFormat()) {
|
||||||
case KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES:
|
||||||
optimizeIndexes();
|
optimizeIndexes();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -1546,7 +1547,7 @@ void KRMesh::getIndexedRange(int index_group, int &start_index_offset, int &star
|
|||||||
int KRMesh::getTriangleVertexIndex(int submesh, int index) const
|
int KRMesh::getTriangleVertexIndex(int submesh, int index) const
|
||||||
{
|
{
|
||||||
switch(getModelFormat()) {
|
switch(getModelFormat()) {
|
||||||
case KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES:
|
||||||
{
|
{
|
||||||
__uint16_t *index_data = getIndexData();
|
__uint16_t *index_data = getIndexData();
|
||||||
|
|
||||||
@@ -1572,7 +1573,7 @@ int KRMesh::getTriangleVertexIndex(int submesh, int index) const
|
|||||||
void KRMesh::optimizeIndexes()
|
void KRMesh::optimizeIndexes()
|
||||||
{
|
{
|
||||||
m_pData->lock();
|
m_pData->lock();
|
||||||
if(getModelFormat() == KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES) {
|
if(getModelFormat() == ModelFormat::KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES) {
|
||||||
|
|
||||||
__uint16_t *new_indices = (__uint16_t *)malloc(0x10000 * sizeof(__uint16_t));
|
__uint16_t *new_indices = (__uint16_t *)malloc(0x10000 * sizeof(__uint16_t));
|
||||||
__uint16_t *vertex_mapping = (__uint16_t *)malloc(0x10000 * sizeof(__uint16_t));
|
__uint16_t *vertex_mapping = (__uint16_t *)malloc(0x10000 * sizeof(__uint16_t));
|
||||||
@@ -1653,7 +1654,7 @@ void KRMesh::optimizeIndexes()
|
|||||||
free(new_indices);
|
free(new_indices);
|
||||||
free(vertex_mapping);
|
free(vertex_mapping);
|
||||||
free(new_vertex_data);
|
free(new_vertex_data);
|
||||||
} // if(getModelFormat() == KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES)
|
} // if(getModelFormat() == ModelFormat::KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES)
|
||||||
|
|
||||||
m_pData->unlock();
|
m_pData->unlock();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,9 @@
|
|||||||
// authors and should not be interpreted as representing official policies, either expressed
|
// authors and should not be interpreted as representing official policies, either expressed
|
||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
|
|
||||||
#include "KRContext.h"
|
#include "KRContext.h"
|
||||||
@@ -47,9 +50,6 @@ using namespace kraken;
|
|||||||
|
|
||||||
#define BUFFER_OFFSET(i) ((char *)NULL + (i))
|
#define BUFFER_OFFSET(i) ((char *)NULL + (i))
|
||||||
|
|
||||||
#ifndef KRMesh_I
|
|
||||||
#define KRMesh_I
|
|
||||||
|
|
||||||
#include "KRMaterialManager.h"
|
#include "KRMaterialManager.h"
|
||||||
#include "KRCamera.h"
|
#include "KRCamera.h"
|
||||||
#include "KRViewport.h"
|
#include "KRViewport.h"
|
||||||
@@ -57,6 +57,14 @@ using namespace kraken;
|
|||||||
class KRMaterial;
|
class KRMaterial;
|
||||||
class KRNode;
|
class KRNode;
|
||||||
|
|
||||||
|
enum class ModelFormat : __uint8_t
|
||||||
|
{
|
||||||
|
KRENGINE_MODEL_FORMAT_TRIANGLES = 0,
|
||||||
|
KRENGINE_MODEL_FORMAT_STRIP,
|
||||||
|
KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES,
|
||||||
|
KRENGINE_MODEL_FORMAT_INDEXED_STRIP
|
||||||
|
};
|
||||||
|
|
||||||
class KRMesh : public KRResource {
|
class KRMesh : public KRResource {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -87,15 +95,10 @@ public:
|
|||||||
KRENGINE_NUM_ATTRIBUTES
|
KRENGINE_NUM_ATTRIBUTES
|
||||||
} vertex_attrib_t;
|
} vertex_attrib_t;
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
KRENGINE_MODEL_FORMAT_TRIANGLES = 0,
|
|
||||||
KRENGINE_MODEL_FORMAT_STRIP,
|
|
||||||
KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES,
|
|
||||||
KRENGINE_MODEL_FORMAT_INDEXED_STRIP
|
|
||||||
} model_format_t;
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
model_format_t format;
|
ModelFormat format;
|
||||||
std::vector<Vector3> vertices;
|
std::vector<Vector3> vertices;
|
||||||
std::vector<__uint16_t> vertex_indexes;
|
std::vector<__uint16_t> vertex_indexes;
|
||||||
std::vector<std::pair<int, int> > vertex_index_bases;
|
std::vector<std::pair<int, int> > vertex_index_bases;
|
||||||
@@ -213,7 +216,7 @@ public:
|
|||||||
Matrix4 getBoneBindPose(int bone_index);
|
Matrix4 getBoneBindPose(int bone_index);
|
||||||
|
|
||||||
|
|
||||||
model_format_t getModelFormat() const;
|
ModelFormat getModelFormat() const;
|
||||||
|
|
||||||
bool lineCast(const Vector3 &v0, const Vector3 &v1, HitInfo &hitinfo) const;
|
bool lineCast(const Vector3 &v0, const Vector3 &v1, HitInfo &hitinfo) const;
|
||||||
bool rayCast(const Vector3 &v0, const Vector3 &dir, HitInfo &hitinfo) const;
|
bool rayCast(const Vector3 &v0, const Vector3 &dir, HitInfo &hitinfo) const;
|
||||||
@@ -289,6 +292,3 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // KRMesh_I
|
|
||||||
@@ -57,7 +57,7 @@ KRMeshCube::KRMeshCube(KRContext &context) : KRMesh(context, "__cube")
|
|||||||
mi.submesh_starts.push_back(0);
|
mi.submesh_starts.push_back(0);
|
||||||
mi.submesh_lengths.push_back((int)mi.vertices.size());
|
mi.submesh_lengths.push_back((int)mi.vertices.size());
|
||||||
mi.material_names.push_back("");
|
mi.material_names.push_back("");
|
||||||
mi.format = KRENGINE_MODEL_FORMAT_STRIP;
|
mi.format = ModelFormat::KRENGINE_MODEL_FORMAT_STRIP;
|
||||||
|
|
||||||
|
|
||||||
LoadData(mi, true, true);
|
LoadData(mi, true, true);
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ KRMeshQuad::KRMeshQuad(KRContext &context) : KRMesh(context, "__quad")
|
|||||||
mi.submesh_starts.push_back(0);
|
mi.submesh_starts.push_back(0);
|
||||||
mi.submesh_lengths.push_back((int)mi.vertices.size());
|
mi.submesh_lengths.push_back((int)mi.vertices.size());
|
||||||
mi.material_names.push_back("");
|
mi.material_names.push_back("");
|
||||||
mi.format = KRENGINE_MODEL_FORMAT_STRIP;
|
mi.format = ModelFormat::KRENGINE_MODEL_FORMAT_STRIP;
|
||||||
|
|
||||||
LoadData(mi, true, true);
|
LoadData(mi, true, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ KRMeshSphere::KRMeshSphere(KRContext &context) : KRMesh(context, "__sphere")
|
|||||||
mi.material_names.push_back("");
|
mi.material_names.push_back("");
|
||||||
|
|
||||||
|
|
||||||
mi.format = KRENGINE_MODEL_FORMAT_TRIANGLES;
|
mi.format = ModelFormat::KRENGINE_MODEL_FORMAT_TRIANGLES;
|
||||||
LoadData(mi, true, true);
|
LoadData(mi, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,10 +98,10 @@ void KRParticleSystemNewtonian::render(RenderInfo& ri) {
|
|||||||
info.directional_lights = &ri.directional_lights;
|
info.directional_lights = &ri.directional_lights;
|
||||||
info.spot_lights = &ri.spot_lights;
|
info.spot_lights = &ri.spot_lights;
|
||||||
info.renderPass = ri.renderPass;
|
info.renderPass = ri.renderPass;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kAdditive;
|
info.rasterMode = RasterMode::kAdditive;
|
||||||
info.cullMode = PipelineInfo::CullMode::kCullNone;
|
info.cullMode = CullMode::kCullNone;
|
||||||
info.vertexAttributes = (1 << KRMesh::KRENGINE_ATTRIB_VERTEX) | (1 << KRMesh::KRENGINE_ATTRIB_TEXUVA);
|
info.vertexAttributes = (1 << KRMesh::KRENGINE_ATTRIB_VERTEX) | (1 << KRMesh::KRENGINE_ATTRIB_TEXUVA);
|
||||||
info.modelFormat = KRMesh::model_format_t::KRENGINE_MODEL_FORMAT_TRIANGLES;
|
info.modelFormat = ModelFormat::KRENGINE_MODEL_FORMAT_TRIANGLES;
|
||||||
|
|
||||||
KRPipeline *pParticleShader = m_pContext->getPipelineManager()->getPipeline(*ri.surface, info);
|
KRPipeline *pParticleShader = m_pContext->getPipelineManager()->getPipeline(*ri.surface, info);
|
||||||
pParticleShader->setUniform(KRPipeline::KRENGINE_UNIFORM_FLARE_SIZE, 1.0f);
|
pParticleShader->setUniform(KRPipeline::KRENGINE_UNIFORM_FLARE_SIZE, 1.0f);
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ const char *KRPipeline::KRENGINE_UNIFORM_NAMES[] = {
|
|||||||
"fade_color", // KRENGINE_UNIFORM_FADE_COLOR
|
"fade_color", // KRENGINE_UNIFORM_FADE_COLOR
|
||||||
};
|
};
|
||||||
|
|
||||||
KRPipeline::KRPipeline(KRContext& context, KRSurface& surface, const PipelineInfo& info, const char* szKey, const std::vector<KRShader*>& shaders, uint32_t vertexAttributes, KRMesh::model_format_t modelFormat)
|
KRPipeline::KRPipeline(KRContext& context, KRSurface& surface, const PipelineInfo& info, const char* szKey, const std::vector<KRShader*>& shaders, uint32_t vertexAttributes, ModelFormat modelFormat)
|
||||||
: KRContextObject(context)
|
: KRContextObject(context)
|
||||||
, m_pushConstantBuffer(nullptr)
|
, m_pushConstantBuffer(nullptr)
|
||||||
, m_pushConstantBufferSize(0)
|
, m_pushConstantBufferSize(0)
|
||||||
@@ -251,12 +251,12 @@ KRPipeline::KRPipeline(KRContext& context, KRSurface& surface, const PipelineInf
|
|||||||
VkPipelineInputAssemblyStateCreateInfo inputAssembly{};
|
VkPipelineInputAssemblyStateCreateInfo inputAssembly{};
|
||||||
inputAssembly.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
|
inputAssembly.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
|
||||||
switch (modelFormat) {
|
switch (modelFormat) {
|
||||||
case KRMesh::model_format_t::KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_INDEXED_TRIANGLES:
|
||||||
case KRMesh::model_format_t::KRENGINE_MODEL_FORMAT_TRIANGLES:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_TRIANGLES:
|
||||||
inputAssembly.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
|
inputAssembly.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
|
||||||
break;
|
break;
|
||||||
case KRMesh::model_format_t::KRENGINE_MODEL_FORMAT_INDEXED_STRIP:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_INDEXED_STRIP:
|
||||||
case KRMesh::model_format_t::KRENGINE_MODEL_FORMAT_STRIP:
|
case ModelFormat::KRENGINE_MODEL_FORMAT_STRIP:
|
||||||
inputAssembly.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
|
inputAssembly.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -290,13 +290,13 @@ KRPipeline::KRPipeline(KRContext& context, KRSurface& surface, const PipelineInf
|
|||||||
rasterizer.polygonMode = VK_POLYGON_MODE_FILL;
|
rasterizer.polygonMode = VK_POLYGON_MODE_FILL;
|
||||||
rasterizer.lineWidth = 1.0f;
|
rasterizer.lineWidth = 1.0f;
|
||||||
switch (info.cullMode) {
|
switch (info.cullMode) {
|
||||||
case PipelineInfo::CullMode::kCullBack:
|
case CullMode::kCullBack:
|
||||||
rasterizer.cullMode = VK_CULL_MODE_BACK_BIT;
|
rasterizer.cullMode = VK_CULL_MODE_BACK_BIT;
|
||||||
break;
|
break;
|
||||||
case PipelineInfo::CullMode::kCullFront:
|
case CullMode::kCullFront:
|
||||||
rasterizer.cullMode = VK_CULL_MODE_FRONT_BIT;
|
rasterizer.cullMode = VK_CULL_MODE_FRONT_BIT;
|
||||||
break;
|
break;
|
||||||
case PipelineInfo::CullMode::kCullNone:
|
case CullMode::kCullNone:
|
||||||
rasterizer.cullMode = VK_CULL_MODE_NONE;
|
rasterizer.cullMode = VK_CULL_MODE_NONE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -319,24 +319,24 @@ KRPipeline::KRPipeline(KRContext& context, KRSurface& surface, const PipelineInf
|
|||||||
colorBlendAttachment.colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT;
|
colorBlendAttachment.colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT;
|
||||||
|
|
||||||
switch (info.rasterMode) {
|
switch (info.rasterMode) {
|
||||||
case PipelineInfo::RasterMode::kOpaque:
|
case RasterMode::kOpaque:
|
||||||
case PipelineInfo::RasterMode::kOpaqueLessTest:
|
case RasterMode::kOpaqueLessTest:
|
||||||
case PipelineInfo::RasterMode::kOpaqueNoTest:
|
case RasterMode::kOpaqueNoTest:
|
||||||
case PipelineInfo::RasterMode::kOpaqueNoDepthWrite:
|
case RasterMode::kOpaqueNoDepthWrite:
|
||||||
colorBlendAttachment.blendEnable = VK_FALSE;
|
colorBlendAttachment.blendEnable = VK_FALSE;
|
||||||
colorBlendAttachment.srcColorBlendFactor = VK_BLEND_FACTOR_ONE;
|
colorBlendAttachment.srcColorBlendFactor = VK_BLEND_FACTOR_ONE;
|
||||||
colorBlendAttachment.dstColorBlendFactor = VK_BLEND_FACTOR_ZERO;
|
colorBlendAttachment.dstColorBlendFactor = VK_BLEND_FACTOR_ZERO;
|
||||||
colorBlendAttachment.colorBlendOp = VK_BLEND_OP_ADD;
|
colorBlendAttachment.colorBlendOp = VK_BLEND_OP_ADD;
|
||||||
break;
|
break;
|
||||||
case PipelineInfo::RasterMode::kAlphaBlend:
|
case RasterMode::kAlphaBlend:
|
||||||
case PipelineInfo::RasterMode::kAlphaBlendNoTest:
|
case RasterMode::kAlphaBlendNoTest:
|
||||||
colorBlendAttachment.blendEnable = VK_TRUE;
|
colorBlendAttachment.blendEnable = VK_TRUE;
|
||||||
colorBlendAttachment.srcColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA;
|
colorBlendAttachment.srcColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA;
|
||||||
colorBlendAttachment.dstColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA;
|
colorBlendAttachment.dstColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA;
|
||||||
colorBlendAttachment.colorBlendOp = VK_BLEND_OP_ADD;
|
colorBlendAttachment.colorBlendOp = VK_BLEND_OP_ADD;
|
||||||
break;
|
break;
|
||||||
case PipelineInfo::RasterMode::kAdditive:
|
case RasterMode::kAdditive:
|
||||||
case PipelineInfo::RasterMode::kAdditiveNoTest:
|
case RasterMode::kAdditiveNoTest:
|
||||||
colorBlendAttachment.blendEnable = VK_TRUE;
|
colorBlendAttachment.blendEnable = VK_TRUE;
|
||||||
colorBlendAttachment.srcColorBlendFactor = VK_BLEND_FACTOR_ONE;
|
colorBlendAttachment.srcColorBlendFactor = VK_BLEND_FACTOR_ONE;
|
||||||
colorBlendAttachment.dstColorBlendFactor = VK_BLEND_FACTOR_ONE;
|
colorBlendAttachment.dstColorBlendFactor = VK_BLEND_FACTOR_ONE;
|
||||||
@@ -393,29 +393,29 @@ KRPipeline::KRPipeline(KRContext& context, KRSurface& surface, const PipelineInf
|
|||||||
VkPipelineDepthStencilStateCreateInfo depthStencil{};
|
VkPipelineDepthStencilStateCreateInfo depthStencil{};
|
||||||
depthStencil.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO;
|
depthStencil.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO;
|
||||||
switch (info.rasterMode) {
|
switch (info.rasterMode) {
|
||||||
case PipelineInfo::RasterMode::kOpaque:
|
case RasterMode::kOpaque:
|
||||||
case PipelineInfo::RasterMode::kOpaqueLessTest:
|
case RasterMode::kOpaqueLessTest:
|
||||||
depthStencil.depthTestEnable = VK_TRUE;
|
depthStencil.depthTestEnable = VK_TRUE;
|
||||||
depthStencil.depthWriteEnable = VK_TRUE;
|
depthStencil.depthWriteEnable = VK_TRUE;
|
||||||
break;
|
break;
|
||||||
case PipelineInfo::RasterMode::kOpaqueNoTest:
|
case RasterMode::kOpaqueNoTest:
|
||||||
depthStencil.depthTestEnable = VK_FALSE;
|
depthStencil.depthTestEnable = VK_FALSE;
|
||||||
depthStencil.depthWriteEnable = VK_TRUE;
|
depthStencil.depthWriteEnable = VK_TRUE;
|
||||||
break;
|
break;
|
||||||
case PipelineInfo::RasterMode::kOpaqueNoDepthWrite:
|
case RasterMode::kOpaqueNoDepthWrite:
|
||||||
case PipelineInfo::RasterMode::kAlphaBlend:
|
case RasterMode::kAlphaBlend:
|
||||||
case PipelineInfo::RasterMode::kAdditive:
|
case RasterMode::kAdditive:
|
||||||
depthStencil.depthTestEnable = VK_TRUE;
|
depthStencil.depthTestEnable = VK_TRUE;
|
||||||
depthStencil.depthWriteEnable = VK_FALSE;
|
depthStencil.depthWriteEnable = VK_FALSE;
|
||||||
break;
|
break;
|
||||||
case PipelineInfo::RasterMode::kAlphaBlendNoTest:
|
case RasterMode::kAlphaBlendNoTest:
|
||||||
case PipelineInfo::RasterMode::kAdditiveNoTest:
|
case RasterMode::kAdditiveNoTest:
|
||||||
depthStencil.depthTestEnable = VK_FALSE;
|
depthStencil.depthTestEnable = VK_FALSE;
|
||||||
depthStencil.depthWriteEnable = VK_FALSE;
|
depthStencil.depthWriteEnable = VK_FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.rasterMode == PipelineInfo::RasterMode::kOpaqueLessTest) {
|
if (info.rasterMode == RasterMode::kOpaqueLessTest) {
|
||||||
depthStencil.depthCompareOp = VK_COMPARE_OP_LESS;
|
depthStencil.depthCompareOp = VK_COMPARE_OP_LESS;
|
||||||
} else {
|
} else {
|
||||||
depthStencil.depthCompareOp = VK_COMPARE_OP_LESS_OR_EQUAL;
|
depthStencil.depthCompareOp = VK_COMPARE_OP_LESS_OR_EQUAL;
|
||||||
|
|||||||
@@ -30,9 +30,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#pragma once
|
||||||
#ifndef KRPIPELINE_H
|
|
||||||
#define KRPIPELINE_H
|
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
#include "KRCamera.h"
|
#include "KRCamera.h"
|
||||||
@@ -44,134 +42,138 @@ class KRShader;
|
|||||||
class KRSurface;
|
class KRSurface;
|
||||||
class KRRenderPass;
|
class KRRenderPass;
|
||||||
|
|
||||||
|
enum class ModelFormat : __uint8_t;
|
||||||
|
|
||||||
|
enum class CullMode : uint32_t {
|
||||||
|
kCullBack = 0,
|
||||||
|
kCullFront,
|
||||||
|
kCullNone
|
||||||
|
};
|
||||||
|
|
||||||
|
// Note: RasterMode is likely to be refactored later to a bitfield
|
||||||
|
enum class RasterMode : uint32_t {
|
||||||
|
kOpaque = 0,
|
||||||
|
/*
|
||||||
|
kOpaque is equivalent to:
|
||||||
|
|
||||||
|
// Disable blending
|
||||||
|
glDisable(GL_BLEND));
|
||||||
|
|
||||||
|
// Enable z-buffer write
|
||||||
|
glDepthMask(GL_TRUE);
|
||||||
|
|
||||||
|
// Enable z-buffer test
|
||||||
|
glEnable(GL_DEPTH_TEST))
|
||||||
|
glDepthFunc(GL_LEQUAL);
|
||||||
|
glDepthRangef(0.0, 1.0);
|
||||||
|
*/
|
||||||
|
kOpaqueNoDepthWrite,
|
||||||
|
/*
|
||||||
|
kOpaque is equivalent to:
|
||||||
|
|
||||||
|
// Disable blending
|
||||||
|
glDisable(GL_BLEND));
|
||||||
|
|
||||||
|
// Disable z-buffer write
|
||||||
|
glDepthMask(GL_FALSE);
|
||||||
|
|
||||||
|
// Enable z-buffer test
|
||||||
|
glEnable(GL_DEPTH_TEST))
|
||||||
|
glDepthFunc(GL_LEQUAL);
|
||||||
|
glDepthRangef(0.0, 1.0);
|
||||||
|
*/
|
||||||
|
kOpaqueLessTest,
|
||||||
|
/*
|
||||||
|
kOpaqueLessTest is equivalent to:
|
||||||
|
|
||||||
|
// Disable blending
|
||||||
|
glDisable(GL_BLEND));
|
||||||
|
|
||||||
|
// Enable z-buffer write
|
||||||
|
glDepthMask(GL_TRUE);
|
||||||
|
|
||||||
|
// Enable z-buffer test
|
||||||
|
glEnable(GL_DEPTH_TEST))
|
||||||
|
glDepthFunc(GL_LESS);
|
||||||
|
glDepthRangef(0.0, 1.0);
|
||||||
|
*/
|
||||||
|
kOpaqueNoTest,
|
||||||
|
/*
|
||||||
|
kOpaqueNoTest is equivalent to:
|
||||||
|
|
||||||
|
// Disable blending
|
||||||
|
glDisable(GL_BLEND));
|
||||||
|
|
||||||
|
// Enable z-buffer write
|
||||||
|
glDepthMask(GL_TRUE);
|
||||||
|
|
||||||
|
// Disable z-buffer test
|
||||||
|
glDisable(GL_DEPTH_TEST)
|
||||||
|
*/
|
||||||
|
kAlphaBlend,
|
||||||
|
/*
|
||||||
|
kAlphaBlend is equivalent to:
|
||||||
|
|
||||||
|
// Enable alpha blending
|
||||||
|
glEnable(GL_BLEND));
|
||||||
|
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA));
|
||||||
|
|
||||||
|
// Disable z-buffer write
|
||||||
|
glDepthMask(GL_FALSE);
|
||||||
|
|
||||||
|
// Enable z-buffer test
|
||||||
|
glEnable(GL_DEPTH_TEST))
|
||||||
|
glDepthFunc(GL_LEQUAL);
|
||||||
|
glDepthRangef(0.0, 1.0);
|
||||||
|
*/
|
||||||
|
kAlphaBlendNoTest,
|
||||||
|
/*
|
||||||
|
kAlphaBlendNoTest is equivalent to:
|
||||||
|
|
||||||
|
// Enable alpha blending
|
||||||
|
glEnable(GL_BLEND));
|
||||||
|
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA));
|
||||||
|
|
||||||
|
// Disable z-buffer write
|
||||||
|
glDepthMask(GL_FALSE);
|
||||||
|
|
||||||
|
// Disable z-buffer test
|
||||||
|
glDisable(GL_DEPTH_TEST)
|
||||||
|
*/
|
||||||
|
kAdditive,
|
||||||
|
/*
|
||||||
|
kAdditive is equivalent to:
|
||||||
|
|
||||||
|
// Enable additive blending
|
||||||
|
glEnable(GL_BLEND));
|
||||||
|
glBlendFunc(GL_ONE, GL_ONE));
|
||||||
|
|
||||||
|
// Disable z-buffer write
|
||||||
|
glDepthMask(GL_FALSE);
|
||||||
|
|
||||||
|
// Enable z-buffer test
|
||||||
|
glEnable(GL_DEPTH_TEST))
|
||||||
|
glDepthFunc(GL_LEQUAL);
|
||||||
|
glDepthRangef(0.0, 1.0);
|
||||||
|
*/
|
||||||
|
kAdditiveNoTest,
|
||||||
|
/*
|
||||||
|
kAdditive is equivalent to:
|
||||||
|
|
||||||
|
// Enable additive blending
|
||||||
|
glEnable(GL_BLEND));
|
||||||
|
glBlendFunc(GL_ONE, GL_ONE));
|
||||||
|
|
||||||
|
// Disable z-buffer write
|
||||||
|
glDepthMask(GL_FALSE);
|
||||||
|
|
||||||
|
// Disable z-buffer test
|
||||||
|
glDisable(GL_DEPTH_TEST)
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
||||||
class PipelineInfo {
|
class PipelineInfo {
|
||||||
public:
|
public:
|
||||||
// Note: RasterMode is likely to be refactored later to a bitfield
|
|
||||||
enum class RasterMode : uint32_t {
|
|
||||||
kOpaque = 0,
|
|
||||||
/*
|
|
||||||
kOpaque is equivalent to:
|
|
||||||
|
|
||||||
// Disable blending
|
|
||||||
glDisable(GL_BLEND));
|
|
||||||
|
|
||||||
// Enable z-buffer write
|
|
||||||
glDepthMask(GL_TRUE);
|
|
||||||
|
|
||||||
// Enable z-buffer test
|
|
||||||
glEnable(GL_DEPTH_TEST))
|
|
||||||
glDepthFunc(GL_LEQUAL);
|
|
||||||
glDepthRangef(0.0, 1.0);
|
|
||||||
*/
|
|
||||||
kOpaqueNoDepthWrite,
|
|
||||||
/*
|
|
||||||
kOpaque is equivalent to:
|
|
||||||
|
|
||||||
// Disable blending
|
|
||||||
glDisable(GL_BLEND));
|
|
||||||
|
|
||||||
// Disable z-buffer write
|
|
||||||
glDepthMask(GL_FALSE);
|
|
||||||
|
|
||||||
// Enable z-buffer test
|
|
||||||
glEnable(GL_DEPTH_TEST))
|
|
||||||
glDepthFunc(GL_LEQUAL);
|
|
||||||
glDepthRangef(0.0, 1.0);
|
|
||||||
*/
|
|
||||||
kOpaqueLessTest,
|
|
||||||
/*
|
|
||||||
kOpaqueLessTest is equivalent to:
|
|
||||||
|
|
||||||
// Disable blending
|
|
||||||
glDisable(GL_BLEND));
|
|
||||||
|
|
||||||
// Enable z-buffer write
|
|
||||||
glDepthMask(GL_TRUE);
|
|
||||||
|
|
||||||
// Enable z-buffer test
|
|
||||||
glEnable(GL_DEPTH_TEST))
|
|
||||||
glDepthFunc(GL_LESS);
|
|
||||||
glDepthRangef(0.0, 1.0);
|
|
||||||
*/
|
|
||||||
kOpaqueNoTest,
|
|
||||||
/*
|
|
||||||
kOpaqueNoTest is equivalent to:
|
|
||||||
|
|
||||||
// Disable blending
|
|
||||||
glDisable(GL_BLEND));
|
|
||||||
|
|
||||||
// Enable z-buffer write
|
|
||||||
glDepthMask(GL_TRUE);
|
|
||||||
|
|
||||||
// Disable z-buffer test
|
|
||||||
glDisable(GL_DEPTH_TEST)
|
|
||||||
*/
|
|
||||||
kAlphaBlend,
|
|
||||||
/*
|
|
||||||
kAlphaBlend is equivalent to:
|
|
||||||
|
|
||||||
// Enable alpha blending
|
|
||||||
glEnable(GL_BLEND));
|
|
||||||
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA));
|
|
||||||
|
|
||||||
// Disable z-buffer write
|
|
||||||
glDepthMask(GL_FALSE);
|
|
||||||
|
|
||||||
// Enable z-buffer test
|
|
||||||
glEnable(GL_DEPTH_TEST))
|
|
||||||
glDepthFunc(GL_LEQUAL);
|
|
||||||
glDepthRangef(0.0, 1.0);
|
|
||||||
*/
|
|
||||||
kAlphaBlendNoTest,
|
|
||||||
/*
|
|
||||||
kAlphaBlendNoTest is equivalent to:
|
|
||||||
|
|
||||||
// Enable alpha blending
|
|
||||||
glEnable(GL_BLEND));
|
|
||||||
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA));
|
|
||||||
|
|
||||||
// Disable z-buffer write
|
|
||||||
glDepthMask(GL_FALSE);
|
|
||||||
|
|
||||||
// Disable z-buffer test
|
|
||||||
glDisable(GL_DEPTH_TEST)
|
|
||||||
*/
|
|
||||||
kAdditive,
|
|
||||||
/*
|
|
||||||
kAdditive is equivalent to:
|
|
||||||
|
|
||||||
// Enable additive blending
|
|
||||||
glEnable(GL_BLEND));
|
|
||||||
glBlendFunc(GL_ONE, GL_ONE));
|
|
||||||
|
|
||||||
// Disable z-buffer write
|
|
||||||
glDepthMask(GL_FALSE);
|
|
||||||
|
|
||||||
// Enable z-buffer test
|
|
||||||
glEnable(GL_DEPTH_TEST))
|
|
||||||
glDepthFunc(GL_LEQUAL);
|
|
||||||
glDepthRangef(0.0, 1.0);
|
|
||||||
*/
|
|
||||||
kAdditiveNoTest,
|
|
||||||
/*
|
|
||||||
kAdditive is equivalent to:
|
|
||||||
|
|
||||||
// Enable additive blending
|
|
||||||
glEnable(GL_BLEND));
|
|
||||||
glBlendFunc(GL_ONE, GL_ONE));
|
|
||||||
|
|
||||||
// Disable z-buffer write
|
|
||||||
glDepthMask(GL_FALSE);
|
|
||||||
|
|
||||||
// Disable z-buffer test
|
|
||||||
glDisable(GL_DEPTH_TEST)
|
|
||||||
*/
|
|
||||||
};
|
|
||||||
enum class CullMode : uint32_t {
|
|
||||||
kCullBack = 0,
|
|
||||||
kCullFront,
|
|
||||||
kCullNone
|
|
||||||
};
|
|
||||||
const std::string* shader_name;
|
const std::string* shader_name;
|
||||||
KRCamera* pCamera;
|
KRCamera* pCamera;
|
||||||
const std::vector<KRPointLight*>* point_lights;
|
const std::vector<KRPointLight*>* point_lights;
|
||||||
@@ -197,14 +199,14 @@ public:
|
|||||||
RasterMode rasterMode;
|
RasterMode rasterMode;
|
||||||
CullMode cullMode;
|
CullMode cullMode;
|
||||||
uint32_t vertexAttributes;
|
uint32_t vertexAttributes;
|
||||||
KRMesh::model_format_t modelFormat;
|
ModelFormat modelFormat;
|
||||||
KRNode::RenderPass renderPass;
|
KRNode::RenderPass renderPass;
|
||||||
};
|
};
|
||||||
|
|
||||||
class KRPipeline : public KRContextObject {
|
class KRPipeline : public KRContextObject {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
KRPipeline(KRContext& context, KRSurface& surface, const PipelineInfo& info, const char* szKey, const std::vector<KRShader*>& shaders, uint32_t vertexAttributes, KRMesh::model_format_t modelFormat);
|
KRPipeline(KRContext& context, KRSurface& surface, const PipelineInfo& info, const char* szKey, const std::vector<KRShader*>& shaders, uint32_t vertexAttributes, ModelFormat modelFormat);
|
||||||
virtual ~KRPipeline();
|
virtual ~KRPipeline();
|
||||||
const char *getKey() const;
|
const char *getKey() const;
|
||||||
|
|
||||||
@@ -305,5 +307,3 @@ private:
|
|||||||
VkPipelineLayout m_pushConstantsLayout;
|
VkPipelineLayout m_pushConstantsLayout;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ KRPipeline* KRPipelineManager::getPipeline(KRSurface& surface, const PipelineInf
|
|||||||
key.second.push_back(surface.m_swapChain->m_extent.width);
|
key.second.push_back(surface.m_swapChain->m_extent.width);
|
||||||
key.second.push_back(surface.m_swapChain->m_extent.height);
|
key.second.push_back(surface.m_swapChain->m_extent.height);
|
||||||
key.second.push_back(info.vertexAttributes);
|
key.second.push_back(info.vertexAttributes);
|
||||||
key.second.push_back(info.modelFormat);
|
key.second.push_back((int)info.modelFormat);
|
||||||
// TODO - Add renderPass unique identifier to key
|
// TODO - Add renderPass unique identifier to key
|
||||||
PipelineMap::iterator itr = m_pipelines.find(key);
|
PipelineMap::iterator itr = m_pipelines.find(key);
|
||||||
if (itr != m_pipelines.end()) {
|
if (itr != m_pipelines.end()) {
|
||||||
@@ -220,10 +220,10 @@ KRPipeline *KRPipelineManager::getPipeline(KRSurface& surface, const PipelineInf
|
|||||||
stream << "\n#define HAS_REFLECTION_CUBE_MAP " << (info.bReflectionCubeMap ? "1" : "0");
|
stream << "\n#define HAS_REFLECTION_CUBE_MAP " << (info.bReflectionCubeMap ? "1" : "0");
|
||||||
|
|
||||||
stream << "\n#define ALPHA_TEST " << (info.bAlphaTest ? "1" : "0");
|
stream << "\n#define ALPHA_TEST " << (info.bAlphaTest ? "1" : "0");
|
||||||
stream << "\n#define ALPHA_BLEND " << ((info.rasterMode == PipelineInfo::RasterMode::kAlphaBlend
|
stream << "\n#define ALPHA_BLEND " << ((info.rasterMode == RasterMode::kAlphaBlend
|
||||||
|| info.rasterMode == PipelineInfo::RasterMode::kAlphaBlendNoTest
|
|| info.rasterMode == RasterMode::kAlphaBlendNoTest
|
||||||
|| info.rasterMode == PipelineInfo::RasterMode::kAdditive
|
|| info.rasterMode == RasterMode::kAdditive
|
||||||
|| info.rasterMode == PipelineInfo::RasterMode::kAdditiveNoTest) ? "1" : "0");
|
|| info.rasterMode == RasterMode::kAdditiveNoTest) ? "1" : "0");
|
||||||
|
|
||||||
stream << "\n#define ENABLE_PER_PIXEL " << (info.pCamera->settings.bEnablePerPixel ? "1" : "0");
|
stream << "\n#define ENABLE_PER_PIXEL " << (info.pCamera->settings.bEnablePerPixel ? "1" : "0");
|
||||||
stream << "\n#define DEBUG_PSSM " << (info.pCamera->settings.bDebugPSSM ? "1" : "0");
|
stream << "\n#define DEBUG_PSSM " << (info.pCamera->settings.bDebugPSSM ? "1" : "0");
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
// or implied, of Kearwood Gilbert.
|
// or implied, of Kearwood Gilbert.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include "KREngine-common.h"
|
#include "KREngine-common.h"
|
||||||
|
|
||||||
@@ -43,9 +44,6 @@ using std::vector;
|
|||||||
|
|
||||||
#include "KRPipeline.h"
|
#include "KRPipeline.h"
|
||||||
|
|
||||||
#ifndef KRPIPELINEMANAGER_H
|
|
||||||
#define KRPIPELINEMANAGER_H
|
|
||||||
|
|
||||||
class KRPipeline;
|
class KRPipeline;
|
||||||
class PipelineInfo;
|
class PipelineInfo;
|
||||||
class KRCamera;
|
class KRCamera;
|
||||||
@@ -67,5 +65,3 @@ private:
|
|||||||
typedef std::map<std::pair<std::string, std::vector<int> >, KRPipeline*> PipelineMap;
|
typedef std::map<std::pair<std::string, std::vector<int> >, KRPipeline*> PipelineMap;
|
||||||
PipelineMap m_pipelines;
|
PipelineMap m_pipelines;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -103,13 +103,13 @@ void KRPointLight::render(RenderInfo& ri)
|
|||||||
info.point_lights = &this_light;
|
info.point_lights = &this_light;
|
||||||
info.renderPass = ri.renderPass;
|
info.renderPass = ri.renderPass;
|
||||||
if (bInsideLight) {
|
if (bInsideLight) {
|
||||||
info.rasterMode = bVisualize ? PipelineInfo::RasterMode::kAdditiveNoTest : PipelineInfo::RasterMode::kAlphaBlendNoTest;
|
info.rasterMode = bVisualize ? RasterMode::kAdditiveNoTest : RasterMode::kAlphaBlendNoTest;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
info.rasterMode = bVisualize ? PipelineInfo::RasterMode::kAdditive : PipelineInfo::RasterMode::kAlphaBlend;
|
info.rasterMode = bVisualize ? RasterMode::kAdditive : RasterMode::kAlphaBlend;
|
||||||
}
|
}
|
||||||
info.vertexAttributes = bInsideLight ? m_pContext->getMeshManager()->KRENGINE_VBO_DATA_2D_SQUARE_VERTICES.getVertexAttributes() : 1 << KRMesh::KRENGINE_ATTRIB_VERTEX;
|
info.vertexAttributes = bInsideLight ? m_pContext->getMeshManager()->KRENGINE_VBO_DATA_2D_SQUARE_VERTICES.getVertexAttributes() : 1 << KRMesh::KRENGINE_ATTRIB_VERTEX;
|
||||||
info.modelFormat = bInsideLight ? KRMesh::model_format_t::KRENGINE_MODEL_FORMAT_STRIP : KRMesh::model_format_t::KRENGINE_MODEL_FORMAT_TRIANGLES;
|
info.modelFormat = bInsideLight ? ModelFormat::KRENGINE_MODEL_FORMAT_STRIP : ModelFormat::KRENGINE_MODEL_FORMAT_TRIANGLES;
|
||||||
|
|
||||||
KRPipeline *pShader = getContext().getPipelineManager()->getPipeline(*ri.surface, info);
|
KRPipeline *pShader = getContext().getPipelineManager()->getPipeline(*ri.surface, info);
|
||||||
pShader->setUniform(KRPipeline::KRENGINE_UNIFORM_LIGHT_COLOR, m_color);
|
pShader->setUniform(KRPipeline::KRENGINE_UNIFORM_LIGHT_COLOR, m_color);
|
||||||
|
|||||||
@@ -1282,7 +1282,7 @@ void LoadMaterial(KRContext &context, FbxSurfaceMaterial *pMaterial) {
|
|||||||
|
|
||||||
void LoadMesh(KRContext &context, FbxScene* pFbxScene, FbxGeometryConverter *pGeometryConverter, FbxMesh* pMesh) {
|
void LoadMesh(KRContext &context, FbxScene* pFbxScene, FbxGeometryConverter *pGeometryConverter, FbxMesh* pMesh) {
|
||||||
KRMesh::mesh_info mi;
|
KRMesh::mesh_info mi;
|
||||||
mi.format = KRMesh::KRENGINE_MODEL_FORMAT_TRIANGLES;
|
mi.format = ModelFormat::KRENGINE_MODEL_FORMAT_TRIANGLES;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
float weights[KRENGINE_MAX_BONE_WEIGHTS_PER_VERTEX];
|
float weights[KRENGINE_MAX_BONE_WEIGHTS_PER_VERTEX];
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ KRMesh* KRResource::LoadObj(KRContext &context, const std::string& path)
|
|||||||
// std::vector<__uint16_t> vertex_indexes;
|
// std::vector<__uint16_t> vertex_indexes;
|
||||||
// std::vector<std::pair<int, int> > vertex_index_bases;
|
// std::vector<std::pair<int, int> > vertex_index_bases;
|
||||||
|
|
||||||
mi.format = KRMesh::KRENGINE_MODEL_FORMAT_TRIANGLES;
|
mi.format = ModelFormat::KRENGINE_MODEL_FORMAT_TRIANGLES;
|
||||||
new_mesh->LoadData(mi, true, false);
|
new_mesh->LoadData(mi, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ void KRReverbZone::render(RenderInfo& ri)
|
|||||||
info.directional_lights = &ri.directional_lights;
|
info.directional_lights = &ri.directional_lights;
|
||||||
info.spot_lights = &ri.spot_lights;
|
info.spot_lights = &ri.spot_lights;
|
||||||
info.renderPass = ri.renderPass;
|
info.renderPass = ri.renderPass;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kAlphaBlend;
|
info.rasterMode = RasterMode::kAlphaBlend;
|
||||||
info.modelFormat = sphereModel->getModelFormat();
|
info.modelFormat = sphereModel->getModelFormat();
|
||||||
info.vertexAttributes = sphereModel->getVertexAttributes();
|
info.vertexAttributes = sphereModel->getVertexAttributes();
|
||||||
|
|
||||||
|
|||||||
@@ -293,9 +293,9 @@ void KRScene::render(KRNode::RenderInfo& ri, KROctreeNode* pOctreeNode, unordere
|
|||||||
info.directional_lights = &ri.directional_lights;
|
info.directional_lights = &ri.directional_lights;
|
||||||
info.spot_lights = &ri.spot_lights;
|
info.spot_lights = &ri.spot_lights;
|
||||||
info.renderPass = KRNode::RENDER_PASS_FORWARD_TRANSPARENT;
|
info.renderPass = KRNode::RENDER_PASS_FORWARD_TRANSPARENT;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kAdditive;
|
info.rasterMode = RasterMode::kAdditive;
|
||||||
info.vertexAttributes = vertices.getVertexAttributes();
|
info.vertexAttributes = vertices.getVertexAttributes();
|
||||||
info.modelFormat = KRMesh::model_format_t::KRENGINE_MODEL_FORMAT_STRIP;
|
info.modelFormat = ModelFormat::KRENGINE_MODEL_FORMAT_STRIP;
|
||||||
|
|
||||||
KRPipeline* pPipeline = getContext().getPipelineManager()->getPipeline(*ri.surface, info);
|
KRPipeline* pPipeline = getContext().getPipelineManager()->getPipeline(*ri.surface, info);
|
||||||
pPipeline->bind(ri.commandBuffer, *info.pCamera, ri.viewport, matModel, info.point_lights, info.directional_lights, info.spot_lights, info.renderPass, Vector3::Zero(), 0.0f, Vector4::Zero());
|
pPipeline->bind(ri.commandBuffer, *info.pCamera, ri.viewport, matModel, info.point_lights, info.directional_lights, info.spot_lights, info.renderPass, Vector3::Zero(), 0.0f, Vector4::Zero());
|
||||||
|
|||||||
@@ -152,10 +152,10 @@ void KRSprite::render(RenderInfo& ri) {
|
|||||||
info.directional_lights = &ri.directional_lights;
|
info.directional_lights = &ri.directional_lights;
|
||||||
info.spot_lights = &ri.spot_lights;
|
info.spot_lights = &ri.spot_lights;
|
||||||
info.renderPass = ri.renderPass;
|
info.renderPass = ri.renderPass;
|
||||||
info.rasterMode = PipelineInfo::RasterMode::kAdditive;
|
info.rasterMode = RasterMode::kAdditive;
|
||||||
info.cullMode = PipelineInfo::CullMode::kCullNone;
|
info.cullMode = CullMode::kCullNone;
|
||||||
info.vertexAttributes = vertices.getVertexAttributes();
|
info.vertexAttributes = vertices.getVertexAttributes();
|
||||||
info.modelFormat = KRMesh::model_format_t::KRENGINE_MODEL_FORMAT_STRIP;
|
info.modelFormat = ModelFormat::KRENGINE_MODEL_FORMAT_STRIP;
|
||||||
|
|
||||||
KRPipeline *pShader = getContext().getPipelineManager()->getPipeline(*ri.surface, info);
|
KRPipeline *pShader = getContext().getPipelineManager()->getPipeline(*ri.surface, info);
|
||||||
pShader->setUniform(KRPipeline::KRENGINE_UNIFORM_MATERIAL_ALPHA, m_spriteAlpha);
|
pShader->setUniform(KRPipeline::KRENGINE_UNIFORM_MATERIAL_ALPHA, m_spriteAlpha);
|
||||||
|
|||||||
Reference in New Issue
Block a user