Open3D (C++ API)  0.11.0
Public Member Functions | Protected Member Functions | Protected Attributes
open3d::visualization::glsl::ShaderWrapper Class Referenceabstract

#include <ShaderWrapper.h>

Inheritance diagram for open3d::visualization::glsl::ShaderWrapper:
open3d::visualization::glsl::ImageMaskShader open3d::visualization::glsl::ImageShader open3d::visualization::glsl::NormalShader open3d::visualization::glsl::PhongShader open3d::visualization::glsl::PickingShader open3d::visualization::glsl::RGBDImageShader open3d::visualization::glsl::Simple2DShader open3d::visualization::glsl::SimpleBlackShader open3d::visualization::glsl::SimpleShader open3d::visualization::glsl::TexturePhongShader open3d::visualization::glsl::TextureSimpleShader

Public Member Functions

virtual ~ShaderWrapper ()
 
 ShaderWrapper (const ShaderWrapper &)=delete
 
ShaderWrapperoperator= (const ShaderWrapper &)=delete
 
bool Render (const geometry::Geometry &geometry, const RenderOption &option, const ViewControl &view)
 
void InvalidateGeometry ()
 
const std::string & GetShaderName () const
 
void PrintShaderWarning (const std::string &message) const
 

Protected Member Functions

 ShaderWrapper (const std::string &name)
 
virtual bool Compile ()=0
 
virtual void Release ()=0
 
virtual bool BindGeometry (const geometry::Geometry &geometry, const RenderOption &option, const ViewControl &view)=0
 
virtual bool RenderGeometry (const geometry::Geometry &geometry, const RenderOption &option, const ViewControl &view)=0
 
virtual void UnbindGeometry ()=0
 
bool ValidateShader (GLuint shader_index)
 
bool ValidateProgram (GLuint program_index)
 
bool CompileShaders (const char *const vertex_shader_code, const char *const geometry_shader_code, const char *const fragment_shader_code)
 
void ReleaseProgram ()
 
void SetShaderName (const std::string &shader_name)
 

Protected Attributes

GLuint vertex_shader_
 
GLuint geometry_shader_
 
GLuint fragment_shader_
 
GLuint program_
 
GLenum draw_arrays_mode_ = GL_POINTS
 
GLsizei draw_arrays_size_ = 0
 
bool compiled_ = false
 
bool bound_ = false
 

Constructor & Destructor Documentation

◆ ~ShaderWrapper()

virtual open3d::visualization::glsl::ShaderWrapper::~ShaderWrapper ( )
inlinevirtual

◆ ShaderWrapper() [1/2]

open3d::visualization::glsl::ShaderWrapper::ShaderWrapper ( const ShaderWrapper )
delete

◆ ShaderWrapper() [2/2]

open3d::visualization::glsl::ShaderWrapper::ShaderWrapper ( const std::string &  name)
inlineprotected

Member Function Documentation

◆ BindGeometry()

virtual bool open3d::visualization::glsl::ShaderWrapper::BindGeometry ( const geometry::Geometry geometry,
const RenderOption option,
const ViewControl view 
)
protectedpure virtual

◆ Compile()

virtual bool open3d::visualization::glsl::ShaderWrapper::Compile ( )
protectedpure virtual

◆ CompileShaders()

bool open3d::visualization::glsl::ShaderWrapper::CompileShaders ( const char *const  vertex_shader_code,
const char *const  geometry_shader_code,
const char *const  fragment_shader_code 
)
protected

◆ GetShaderName()

const std::string& open3d::visualization::glsl::ShaderWrapper::GetShaderName ( ) const
inline

◆ InvalidateGeometry()

void open3d::visualization::glsl::ShaderWrapper::InvalidateGeometry ( )

Function to invalidate the geometry (set the dirty flag and release geometry resource)

◆ operator=()

ShaderWrapper& open3d::visualization::glsl::ShaderWrapper::operator= ( const ShaderWrapper )
delete

◆ PrintShaderWarning()

void open3d::visualization::glsl::ShaderWrapper::PrintShaderWarning ( const std::string &  message) const

◆ Release()

virtual void open3d::visualization::glsl::ShaderWrapper::Release ( )
protectedpure virtual

◆ ReleaseProgram()

void open3d::visualization::glsl::ShaderWrapper::ReleaseProgram ( )
protected

◆ Render()

bool open3d::visualization::glsl::ShaderWrapper::Render ( const geometry::Geometry geometry,
const RenderOption option,
const ViewControl view 
)

Function to render geometry under condition of mode and view The geometry is updated in a passive manner (bind only when needed). Thus this function compiles shaders if not yet, binds geometry if not yet, then do the rendering.

◆ RenderGeometry()

virtual bool open3d::visualization::glsl::ShaderWrapper::RenderGeometry ( const geometry::Geometry geometry,
const RenderOption option,
const ViewControl view 
)
protectedpure virtual

◆ SetShaderName()

void open3d::visualization::glsl::ShaderWrapper::SetShaderName ( const std::string &  shader_name)
inlineprotected

◆ UnbindGeometry()

virtual void open3d::visualization::glsl::ShaderWrapper::UnbindGeometry ( )
protectedpure virtual

◆ ValidateProgram()

bool open3d::visualization::glsl::ShaderWrapper::ValidateProgram ( GLuint  program_index)
protected

◆ ValidateShader()

bool open3d::visualization::glsl::ShaderWrapper::ValidateShader ( GLuint  shader_index)
protected

Field Documentation

◆ bound_

bool open3d::visualization::glsl::ShaderWrapper::bound_ = false
protected

◆ compiled_

bool open3d::visualization::glsl::ShaderWrapper::compiled_ = false
protected

◆ draw_arrays_mode_

GLenum open3d::visualization::glsl::ShaderWrapper::draw_arrays_mode_ = GL_POINTS
protected

◆ draw_arrays_size_

GLsizei open3d::visualization::glsl::ShaderWrapper::draw_arrays_size_ = 0
protected

◆ fragment_shader_

GLuint open3d::visualization::glsl::ShaderWrapper::fragment_shader_
protected

◆ geometry_shader_

GLuint open3d::visualization::glsl::ShaderWrapper::geometry_shader_
protected

◆ program_

GLuint open3d::visualization::glsl::ShaderWrapper::program_
protected

◆ vertex_shader_

GLuint open3d::visualization::glsl::ShaderWrapper::vertex_shader_
protected

The documentation for this class was generated from the following files: