本文整理汇总了C++中MeshBuilder::AddQuad方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshBuilder::AddQuad方法的具体用法?C++ MeshBuilder::AddQuad怎么用?C++ MeshBuilder::AddQuad使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MeshBuilder
的用法示例。
在下文中一共展示了MeshBuilder::AddQuad方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetUpShader
TheGame::TheGame()
: m_pauseTexture(Texture::CreateOrGetTexture("Data/Images/Test.png"))
, m_camera(new Camera3D())
, m_twahSFX(AudioSystem::instance->CreateOrGetSound("Data/SFX/Twah.wav"))
, m_renderAxisLines(false)
, m_showSkeleton(false)
{
SetUpShader();
#pragma TODO("Fix this blatant memory leak")
Texture* blankTex = new Texture(1600, 900, Texture::TextureFormat::RGBA8);
Texture* depthTex = new Texture(1600, 900, Texture::TextureFormat::D24S8);
m_fbo = Framebuffer::FramebufferCreate(1, &blankTex, depthTex);
Material* fboMaterial = new Material(new ShaderProgram("Data/Shaders/Post/post.vert", "Data/Shaders/Post/post.frag"), //post_pixelation
RenderState(RenderState::DepthTestingMode::ON, RenderState::FaceCullingMode::RENDER_BACK_FACES, RenderState::BlendMode::ALPHA_BLEND));
fboMaterial->SetDiffuseTexture(blankTex);
fboMaterial->SetNormalTexture(depthTex);
MeshBuilder builder;
builder.AddQuad(Vector3(-1, -1, 0), Vector3::UP, 2.0f, Vector3::RIGHT, 2.0f);
quadForFBO = new MeshRenderer(new Mesh(), fboMaterial);
builder.CopyToMesh(quadForFBO->m_mesh, &Vertex_PCUTB::Copy, sizeof(Vertex_PCUTB), &Vertex_PCUTB::BindMeshToVAO);
quadForFBO->m_material->SetFloatUniform("gPixelationFactor", 8.0f);
}