forked from blender/blender
Move to use the GPU API instead OpenGL #23
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
#include "BKE_lib_id.h"
|
#include "BKE_lib_id.h"
|
||||||
#include "DEG_depsgraph_query.h"
|
#include "DEG_depsgraph_query.h"
|
||||||
|
#include "GPU_texture.h"
|
||||||
|
#include "GPU_framebuffer.h"
|
||||||
|
|
||||||
#include "camera.h"
|
#include "camera.h"
|
||||||
#include "final_engine.h"
|
#include "final_engine.h"
|
||||||
@ -195,6 +197,20 @@ void FinalEngineGL::render(Depsgraph *depsgraph)
|
|||||||
{"Combined", std::vector<float>(res[0] * res[1] * 4)}}; // 4 - number of channels
|
{"Combined", std::vector<float>(res[0] * res[1] * 4)}}; // 4 - number of channels
|
||||||
std::vector<float> &pixels = render_images["Combined"];
|
std::vector<float> &pixels = render_images["Combined"];
|
||||||
|
|
||||||
|
//GPUFrameBuffer *framebuffer = GPU_framebuffer_create("fbHydraRenderFinal");
|
||||||
|
//GPUTexture *texture = GPU_texture_create_2d("texHydraRenderViewport",
|
||||||
|
// res[0],
|
||||||
|
// res[1],
|
||||||
|
// 1,
|
||||||
|
// GPU_RGBA32F,
|
||||||
|
// GPU_TEXTURE_USAGE_GENERAL,
|
||||||
|
// nullptr);
|
||||||
|
//GPU_texture_filter_mode(texture, true);
|
||||||
|
//GPU_texture_wrap_mode(texture, true, true);
|
||||||
|
//GPU_framebuffer_texture_attach(framebuffer, texture, 0, 0);
|
||||||
|
|
||||||
|
//GPU_framebuffer_bind(framebuffer);
|
||||||
|
|
||||||
GLuint framebuffer_name = 0;
|
GLuint framebuffer_name = 0;
|
||||||
glGenFramebuffers(1, &framebuffer_name);
|
glGenFramebuffers(1, &framebuffer_name);
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer_name);
|
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer_name);
|
||||||
|
@ -180,7 +180,7 @@ void DrawTexture::create(pxr::HdRenderBuffer *buffer)
|
|||||||
channels = pxr::HdGetComponentCount(buffer->GetFormat());
|
channels = pxr::HdGetComponentCount(buffer->GetFormat());
|
||||||
|
|
||||||
void *data = buffer->Map();
|
void *data = buffer->Map();
|
||||||
texture = GPU_texture_create_2d("HydraRendeViewport",
|
texture = GPU_texture_create_2d("texHydraRenderViewport",
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
1,
|
1,
|
||||||
|
Loading…
Reference in New Issue
Block a user