Beispiel #1
0
void OculusHud::Render()
{
    if(show) {
        // If render function defined, use it to render left / right images
        // to framebuffer
        if(this->extern_draw_function) {
            framebuffer.Bind();
            glClearColor(1,1,1,0);
            glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
            for(int i=0; i<2; ++i) {
                eyeview[i].Activate();
                default_cam.ApplyNView(i);
                this->extern_draw_function(*this);
            }
            framebuffer.Unbind();
        }

        if(common.IsShown() && common.NumChildren()) {
            framebuffer.Bind();
            RenderChildren();
            for(int i=0; i<2; ++i) {
                Viewport v = eyeview[i].v;
                v.l += 160 -i*120;
                v.w -= 160;
                v.h -= 220;
                common.Resize(v);
                common.Render();
            }
            framebuffer.Unbind();
        }

        RenderFramebuffer();
    }
}
Beispiel #2
0
void MatrixTransform::Render(Graphics::Renderer *renderer, const matrix4x4f &trans, RenderData *rd)
{
	const matrix4x4f t = trans * m_transform;
	//renderer->SetTransform(t);
	//DrawAxes(renderer);
	RenderChildren(renderer, t, rd);
}
Beispiel #3
0
void View::Render()
{
    if(extern_draw_function && show) {
        extern_draw_function(*this);
    }
    RenderChildren();
}
Beispiel #4
0
	void MatrixTransform::Render(const std::vector<matrix4x4f> &trans, const RenderData *rd)
	{
		PROFILE_SCOPED();
		if (0 == memcmp(&m_transform, &s_ident, sizeof(matrix4x4f))) {
			// m_transform is identity so avoid performing all multiplications
			RenderChildren(trans, rd);
		} else {
			// m_transform is valid, modify all positions by it
			const size_t transSize = trans.size();
			std::vector<matrix4x4f> t;
			t.resize(transSize);
			for (size_t tIdx = 0; tIdx < transSize; tIdx++) {
				t[tIdx] = trans[tIdx] * m_transform;
			}
			RenderChildren(t, rd);
		}
	}
Beispiel #5
0
void RootNode::Render(Scene *scene, Renderer *renderer)
{
    // first sort children before rendering based on depth (shader|material)
    std::sort(m_Children.begin(), m_Children.end(), SortSceneNodes);

    // configure all render passes here
    // - render all children into post-processing framebuffer
    renderer->PrePostProcessRender();
        RenderChildren(scene, renderer);
    renderer->PostPostProcessRender();
    // - render quad with post-processing effect enabled
    renderer->PostProcessQuadRender();
}
Beispiel #6
0
        void    Widget::Render(RenderTarget& target, RenderQueue& queue) const
        {
            OnPaint(target, queue);

            if (mUseScissor)
            {
                Area& area = ResourceManager::Get()->WidgetArea;
                area.PushArea(GetRect(true));
                const FloatRect& top = area.GetTopArea();

                target.Flush();

                RenderChildren(target, queue);

                queue.SetScissor(true, Vector2f(top.Left, target.GetHeight() - top.Bottom), Vector2f(top.GetSize().x, top.GetSize().y));
                target.Flush();
                area.PopArea();
            }
            else
            {
                queue.SetScissor(false);
                RenderChildren(target, queue);
            }
        }
Beispiel #7
0
void Group::Render(Graphics::Renderer *renderer, const matrix4x4f &trans, RenderData *rd)
{
	RenderChildren(renderer, trans, rd);
}
Beispiel #8
0
	void MatrixTransform::Render(const matrix4x4f &trans, const RenderData *rd)
	{
		PROFILE_SCOPED();
		const matrix4x4f t = trans * m_transform;
		RenderChildren(t, rd);
	}
void MatrixTransform::Render(const matrix4x4f &trans, const RenderData *rd)
{
	const matrix4x4f t = trans * m_transform;
	RenderChildren(t, rd);
}
Beispiel #10
0
void Group::Render(const matrix4x4f &trans, RenderData *rd)
{
	RenderChildren(trans, rd);
}
Beispiel #11
0
void Object::OnRender() {
	RenderChildren();
}
Beispiel #12
0
void Actor::Render(D3DRenderer* renderer)
{
	RenderComponents(renderer);
	RenderChildren(renderer);
}
Beispiel #13
0
	void EntityManager::Render(TCODConsole* console)
	{
		RenderChildren(console);
	}
Beispiel #14
0
    void Effect::Render(Matrix* in_parentMatrix, float in_parentAlpha)
    {
        if (!m_visible)
        {
            return;
        }

        // generate our matrix
        Matrix transform = Matrix::Identity;
        transform *= Matrix::CreateScale(m_scale.get().x, m_scale.get().y, 1.f);
        transform *= Matrix::CreateRotationZ(DirectX::XMConvertToRadians(m_angle));
        transform *= Matrix::CreateTranslation(m_position.get().x, m_position.get().y, 0);

        if (in_parentMatrix)
        {
            transform = transform * *in_parentMatrix;
        }

        bool hasEffect = m_blurEnabled || m_sepiaEnabled || m_crtEnabled || m_cartoonEnabled || m_vignetteEnabled;

        if (!m_effectTarget && hasEffect)
        {
            m_effectTarget = OTexture::createScreenRenderTarget(true);
        }
        if (m_effectTarget && !hasEffect)
        {
            delete m_effectTarget;
            m_effectTarget = nullptr;
        }

        bool scissorEnabled = ORenderer->getScissorEnabled();
        Rect scissorRect = ORenderer->getScissor();

        if (hasEffect)
        {
            OSB->end();
            const Matrix& spriteBatchTransform = OSB->getTransform();
            m_effectTarget->bindRenderTarget();
            m_effectTarget->clearRenderTarget(Color::Transparent);
            OSB->begin(spriteBatchTransform);
            if (scissorEnabled)
            {
                ORenderer->setScissor(scissorEnabled, scissorRect);
            }
        }

        // render bg children
        RenderChildren(m_bgChildren, &transform, m_color.get().w * in_parentAlpha);

        // render fg children
        RenderChildren(m_fgChildren, &transform, m_color.get().w * in_parentAlpha);

        if (hasEffect)
        {
            OSB->end();
            Matrix spriteBatchTransform = OSB->getTransform();
            m_effectTarget->unbindRenderTarget();

            // Apply the effects
            if (m_cartoonEnabled)
            {
                m_effectTarget->cartoon(m_cartoonTone);
            }
            if (m_sepiaEnabled)
            {
                m_effectTarget->sepia(m_sepiaTone, m_sepiaSaturation, m_sepiaAmount);
            }
            if (m_blurEnabled)
            {
                m_effectTarget->blur(m_blurAmount);
            }
            if (m_vignetteEnabled)
            {
                m_effectTarget->vignette(m_vignetteAmount);
            }
            if (m_crtEnabled)
            {
                m_effectTarget->crt();
            }

            OSB->begin();
            if (scissorEnabled)
            {
                ORenderer->setScissor(scissorEnabled, scissorRect);
            }
            OSB->drawRect(m_effectTarget, ORectFullScreen);
            OSB->end();
            OSB->begin(spriteBatchTransform);
            if (scissorEnabled)
            {
                ORenderer->setScissor(scissorEnabled, scissorRect);
            }
        }
    }
Beispiel #15
0
void Group::Render(const matrix4x4f &trans, const RenderData *rd)
{
	PROFILE_SCOPED()
	RenderChildren(trans, rd);
}