2016-04-13 06:07:23 +00:00
|
|
|
#ifndef __URDE_CLINERENDERERSHADERS_HPP__
|
|
|
|
#define __URDE_CLINERENDERERSHADERS_HPP__
|
2016-02-18 02:42:32 +00:00
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
#include "Graphics/CGraphics.hpp"
|
2016-02-18 02:42:32 +00:00
|
|
|
#include "boo/graphicsdev/GL.hpp"
|
|
|
|
#include "boo/graphicsdev/D3D.hpp"
|
|
|
|
#include "boo/graphicsdev/Metal.hpp"
|
2016-02-23 02:34:16 +00:00
|
|
|
#include "boo/graphicsdev/Vulkan.hpp"
|
2016-02-18 02:42:32 +00:00
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
namespace urde
|
2016-02-18 02:42:32 +00:00
|
|
|
{
|
|
|
|
class CLineRenderer;
|
|
|
|
|
|
|
|
class CLineRendererShaders
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
struct IDataBindingFactory
|
|
|
|
{
|
2016-03-30 19:16:01 +00:00
|
|
|
virtual void BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
|
|
|
CLineRenderer& renderer,
|
2017-11-05 06:17:12 +00:00
|
|
|
const boo::ObjToken<boo::IShaderPipeline>& pipeline,
|
|
|
|
const boo::ObjToken<boo::ITexture>& texture)=0;
|
2018-05-07 00:47:40 +00:00
|
|
|
virtual ~IDataBindingFactory() = default;
|
2016-02-18 02:42:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
2017-11-05 06:17:12 +00:00
|
|
|
static boo::ObjToken<boo::IShaderPipeline> m_texAlpha;
|
|
|
|
static boo::ObjToken<boo::IShaderPipeline> m_texAdditive;
|
2016-02-18 02:42:32 +00:00
|
|
|
|
2017-11-05 06:17:12 +00:00
|
|
|
static boo::ObjToken<boo::IShaderPipeline> m_noTexAlpha;
|
|
|
|
static boo::ObjToken<boo::IShaderPipeline> m_noTexAdditive;
|
2016-02-18 02:42:32 +00:00
|
|
|
|
2018-05-08 05:10:24 +00:00
|
|
|
static boo::ObjToken<boo::IShaderPipeline> m_texAlphaZ;
|
|
|
|
static boo::ObjToken<boo::IShaderPipeline> m_texAdditiveZ;
|
|
|
|
|
|
|
|
static boo::ObjToken<boo::IShaderPipeline> m_noTexAlphaZ;
|
|
|
|
static boo::ObjToken<boo::IShaderPipeline> m_noTexAdditiveZ;
|
|
|
|
|
2018-05-20 06:14:57 +00:00
|
|
|
static boo::ObjToken<boo::IShaderPipeline> m_noTexAlphaZGEqual;
|
|
|
|
|
2017-11-05 06:17:12 +00:00
|
|
|
static boo::ObjToken<boo::IVertexFormat> m_texVtxFmt;
|
|
|
|
static boo::ObjToken<boo::IVertexFormat> m_noTexVtxFmt;
|
2016-02-18 07:36:36 +00:00
|
|
|
|
2016-02-18 02:42:32 +00:00
|
|
|
static std::unique_ptr<IDataBindingFactory> m_bindFactory;
|
|
|
|
|
|
|
|
public:
|
2017-12-06 03:26:15 +00:00
|
|
|
#if BOO_HAS_GL
|
2016-03-30 19:16:01 +00:00
|
|
|
static IDataBindingFactory* Initialize(boo::GLDataFactory::Context& ctx);
|
2017-12-06 03:26:15 +00:00
|
|
|
#endif
|
2016-02-18 02:42:32 +00:00
|
|
|
#if _WIN32
|
2018-05-25 06:39:38 +00:00
|
|
|
static IDataBindingFactory* Initialize(boo::D3DDataFactory::Context& ctx);
|
2016-02-23 02:34:16 +00:00
|
|
|
#endif
|
|
|
|
#if BOO_HAS_METAL
|
2016-03-30 19:16:01 +00:00
|
|
|
static IDataBindingFactory* Initialize(boo::MetalDataFactory::Context& ctx);
|
2016-02-18 02:42:32 +00:00
|
|
|
#endif
|
2016-02-23 02:34:16 +00:00
|
|
|
#if BOO_HAS_VULKAN
|
2016-03-30 19:16:01 +00:00
|
|
|
static IDataBindingFactory* Initialize(boo::VulkanDataFactory::Context& ctx);
|
2016-02-23 02:34:16 +00:00
|
|
|
#endif
|
2016-02-18 02:42:32 +00:00
|
|
|
|
|
|
|
static void Initialize();
|
|
|
|
static void Shutdown();
|
2016-03-30 19:16:01 +00:00
|
|
|
static void BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, CLineRenderer& renderer,
|
2018-05-20 06:14:57 +00:00
|
|
|
const boo::ObjToken<boo::ITexture>& texture, bool additive, bool zTest,
|
|
|
|
bool zGEqual);
|
2016-02-18 02:42:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-04-13 06:07:23 +00:00
|
|
|
#endif // __URDE_CLINERENDERERSHADERS_HPP__
|