Removing RenderFrame parameters no longer needed with Vulkan and KRSurface
This commit is contained in:
@@ -46,8 +46,6 @@ KRCamera::KRCamera(KRScene &scene, std::string name) : KRNode(scene, name) {
|
|||||||
m_last_frame_start = 0;
|
m_last_frame_start = 0;
|
||||||
|
|
||||||
m_particlesAbsoluteTime = 0.0f;
|
m_particlesAbsoluteTime = 0.0f;
|
||||||
m_backingWidth = 0;
|
|
||||||
m_backingHeight = 0;
|
|
||||||
volumetricBufferWidth = 0;
|
volumetricBufferWidth = 0;
|
||||||
volumetricBufferHeight = 0;
|
volumetricBufferHeight = 0;
|
||||||
m_pSkyBoxTexture = NULL;
|
m_pSkyBoxTexture = NULL;
|
||||||
@@ -102,7 +100,7 @@ const std::string KRCamera::getSkyBox() const
|
|||||||
return m_skyBox;
|
return m_skyBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KRCamera::renderFrame(VkCommandBuffer& commandBuffer, KRSurface& surface, GLint defaultFBO, GLint renderBufferWidth, GLint renderBufferHeight)
|
void KRCamera::renderFrame(VkCommandBuffer& commandBuffer, KRSurface& surface)
|
||||||
{
|
{
|
||||||
// ----====---- Record timing information for measuring FPS ----====----
|
// ----====---- Record timing information for measuring FPS ----====----
|
||||||
uint64_t current_time = m_pContext->getAbsoluteTimeMilliseconds();
|
uint64_t current_time = m_pContext->getAbsoluteTimeMilliseconds();
|
||||||
@@ -112,7 +110,7 @@ void KRCamera::renderFrame(VkCommandBuffer& commandBuffer, KRSurface& surface, G
|
|||||||
}
|
}
|
||||||
m_last_frame_start = current_time;
|
m_last_frame_start = current_time;
|
||||||
|
|
||||||
createBuffers(renderBufferWidth, renderBufferHeight);
|
createBuffers(surface.getWidth(), surface.getHeight());
|
||||||
|
|
||||||
KRScene &scene = getScene();
|
KRScene &scene = getScene();
|
||||||
|
|
||||||
@@ -121,7 +119,7 @@ void KRCamera::renderFrame(VkCommandBuffer& commandBuffer, KRSurface& surface, G
|
|||||||
|
|
||||||
//Matrix4 viewMatrix = Matrix4::Invert(getModelMatrix());
|
//Matrix4 viewMatrix = Matrix4::Invert(getModelMatrix());
|
||||||
|
|
||||||
settings.setViewportSize(Vector2::Create((float)m_backingWidth, (float)m_backingHeight));
|
settings.setViewportSize(Vector2::Create((float)surface.getWidth(), (float)surface.getHeight()));
|
||||||
Matrix4 projectionMatrix;
|
Matrix4 projectionMatrix;
|
||||||
projectionMatrix.perspective(settings.perspective_fov, settings.m_viewportSize.x / settings.m_viewportSize.y, settings.perspective_nearz, settings.perspective_farz);
|
projectionMatrix.perspective(settings.perspective_fov, settings.m_viewportSize.x / settings.m_viewportSize.y, settings.perspective_nearz, settings.perspective_farz);
|
||||||
m_viewport = KRViewport(settings.getViewportSize(), viewMatrix, projectionMatrix);
|
m_viewport = KRViewport(settings.getViewportSize(), viewMatrix, projectionMatrix);
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public:
|
|||||||
KRCamera(KRScene &scene, std::string name);
|
KRCamera(KRScene &scene, std::string name);
|
||||||
virtual ~KRCamera();
|
virtual ~KRCamera();
|
||||||
|
|
||||||
void renderFrame(VkCommandBuffer& commandBuffer, KRSurface& surface, GLint defaultFBO);
|
void renderFrame(VkCommandBuffer& commandBuffer, KRSurface& surface);
|
||||||
|
|
||||||
KRRenderSettings settings;
|
KRRenderSettings settings;
|
||||||
|
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ void KRPresentationThread::renderFrame()
|
|||||||
// TODO - This needs to be moved to the Render thread...
|
// TODO - This needs to be moved to the Render thread...
|
||||||
float deltaTime = 0.005; // TODO - Replace dummy value
|
float deltaTime = 0.005; // TODO - Replace dummy value
|
||||||
if (scene) {
|
if (scene) {
|
||||||
scene->renderFrame(commandBuffer, surface, 0, deltaTime, surface.m_swapChain->m_extent.width, surface.m_swapChain->m_extent.height);
|
scene->renderFrame(commandBuffer, surface, deltaTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vkEndCommandBuffer(commandBuffer) != VK_SUCCESS) {
|
if (vkEndCommandBuffer(commandBuffer) != VK_SUCCESS) {
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ KRScene::~KRScene() {
|
|||||||
m_pRootNode = NULL;
|
m_pRootNode = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KRScene::renderFrame(VkCommandBuffer& commandBuffer, KRSurface& surface, GLint defaultFBO, float deltaTime) {
|
void KRScene::renderFrame(VkCommandBuffer& commandBuffer, KRSurface& surface, float deltaTime) {
|
||||||
getContext().startFrame(deltaTime);
|
getContext().startFrame(deltaTime);
|
||||||
KRCamera *camera = find<KRCamera>("default_camera");
|
KRCamera *camera = find<KRCamera>("default_camera");
|
||||||
if(camera == NULL) {
|
if(camera == NULL) {
|
||||||
@@ -70,7 +70,7 @@ void KRScene::renderFrame(VkCommandBuffer& commandBuffer, KRSurface& surface, GL
|
|||||||
getContext().getAudioManager()->setReverbMaxLength(camera->settings.siren_reverb_max_length);
|
getContext().getAudioManager()->setReverbMaxLength(camera->settings.siren_reverb_max_length);
|
||||||
getContext().getTextureManager()->setMaxAnisotropy(camera->settings.max_anisotropy);
|
getContext().getTextureManager()->setMaxAnisotropy(camera->settings.max_anisotropy);
|
||||||
|
|
||||||
camera->renderFrame(commandBuffer, surface, defaultFBO);
|
camera->renderFrame(commandBuffer, surface);
|
||||||
getContext().endFrame(deltaTime);
|
getContext().endFrame(deltaTime);
|
||||||
physicsUpdate(deltaTime);
|
physicsUpdate(deltaTime);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public:
|
|||||||
bool rayCast(const Vector3 &v0, const Vector3 &dir, HitInfo &hitinfo, unsigned int layer_mask);
|
bool rayCast(const Vector3 &v0, const Vector3 &dir, HitInfo &hitinfo, unsigned int layer_mask);
|
||||||
bool sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, HitInfo &hitinfo, unsigned int layer_mask);
|
bool sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, HitInfo &hitinfo, unsigned int layer_mask);
|
||||||
|
|
||||||
void renderFrame(VkCommandBuffer& commandBuffer, KRSurface& surface, GLint defaultFBO, float deltaTime);
|
void renderFrame(VkCommandBuffer& commandBuffer, KRSurface& surface, float deltaTime);
|
||||||
void render(VkCommandBuffer& commandBuffer, KRCamera *pCamera, unordered_map<AABB, int> &visibleBounds, const KRViewport &viewport, KRNode::RenderPass renderPass, bool new_frame);
|
void render(VkCommandBuffer& commandBuffer, KRCamera *pCamera, unordered_map<AABB, int> &visibleBounds, const KRViewport &viewport, KRNode::RenderPass renderPass, bool new_frame);
|
||||||
|
|
||||||
void render(VkCommandBuffer& commandBuffer, KROctreeNode *pOctreeNode, unordered_map<AABB, int> &visibleBounds, KRCamera *pCamera, std::vector<KRPointLight *> &point_lights, std::vector<KRDirectionalLight *> &directional_lights, std::vector<KRSpotLight *>&spot_lights, const KRViewport &viewport, KRNode::RenderPass renderPass, std::vector<KROctreeNode *> &remainingOctrees, std::vector<KROctreeNode *> &remainingOctreesTestResults, std::vector<KROctreeNode *> &remainingOctreesTestResultsOnly, bool bOcclusionResultsPass, bool bOcclusionTestResultsOnly);
|
void render(VkCommandBuffer& commandBuffer, KROctreeNode *pOctreeNode, unordered_map<AABB, int> &visibleBounds, KRCamera *pCamera, std::vector<KRPointLight *> &point_lights, std::vector<KRDirectionalLight *> &directional_lights, std::vector<KRSpotLight *>&spot_lights, const KRViewport &viewport, KRNode::RenderPass renderPass, std::vector<KROctreeNode *> &remainingOctrees, std::vector<KROctreeNode *> &remainingOctreesTestResults, std::vector<KROctreeNode *> &remainingOctreesTestResultsOnly, bool bOcclusionResultsPass, bool bOcclusionTestResultsOnly);
|
||||||
|
|||||||
Reference in New Issue
Block a user