Replace GLFloats with floats.

Refactor KRCamera and KRScene to use width and height from KRSurface rather than stack and members.
This commit is contained in:
2022-04-03 23:05:30 -07:00
parent b6922dc63f
commit c51f776899
3 changed files with 9 additions and 10 deletions

View File

@@ -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, GLint renderBufferWidth, GLint renderBufferHeight); void renderFrame(VkCommandBuffer& commandBuffer, KRSurface& surface, GLint defaultFBO);
KRRenderSettings settings; KRRenderSettings settings;
@@ -80,7 +80,6 @@ public:
private: private:
void createBuffers(GLint renderBufferWidth, GLint renderBufferHeight); void createBuffers(GLint renderBufferWidth, GLint renderBufferHeight);
GLint m_backingWidth, m_backingHeight;
GLint volumetricBufferWidth, volumetricBufferHeight; GLint volumetricBufferWidth, volumetricBufferHeight;
GLuint compositeFramebuffer, compositeDepthTexture, compositeColorTexture; GLuint compositeFramebuffer, compositeDepthTexture, compositeColorTexture;
@@ -104,11 +103,11 @@ private:
Vector4 m_fade_color; Vector4 m_fade_color;
typedef struct { typedef struct {
GLfloat x; float x;
GLfloat y; float y;
GLfloat z; float z;
GLfloat u; float u;
GLfloat v; float v;
} DebugTextVertexData; } DebugTextVertexData;
KRDataBlock m_debug_text_vertices; KRDataBlock m_debug_text_vertices;

View File

@@ -54,7 +54,7 @@ KRScene::~KRScene() {
m_pRootNode = NULL; m_pRootNode = NULL;
} }
void KRScene::renderFrame(VkCommandBuffer& commandBuffer, KRSurface& surface, GLint defaultFBO, float deltaTime, int width, int height) { void KRScene::renderFrame(VkCommandBuffer& commandBuffer, KRSurface& surface, GLint defaultFBO, 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, width, height); camera->renderFrame(commandBuffer, surface, defaultFBO);
getContext().endFrame(deltaTime); getContext().endFrame(deltaTime);
physicsUpdate(deltaTime); physicsUpdate(deltaTime);
} }

View File

@@ -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, int width, int height); void renderFrame(VkCommandBuffer& commandBuffer, KRSurface& surface, GLint defaultFBO, 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);