6 #ifndef CNOID_BASE_GLSL_SCENE_RENDERER_H
7 #define CNOID_BASE_GLSL_SCENE_RENDERER_H
9 #include <cnoid/GLSceneRenderer>
10 #include "exportdecl.h"
15 class LightingProgram;
24 virtual void applyExtensions()
override;
25 virtual bool applyNewExtensions()
override;
27 virtual void setOutputStream(std::ostream& os)
override;
30 virtual void renderCustomGroup(
SgGroup* transform, std::function<
void()> traverseFunction)
override;
31 virtual void renderCustomTransform(
SgTransform* transform, std::function<
void()> traverseFunction)
override;
32 virtual void renderNode(
SgNode* node)
override;
35 virtual void clearNodeDecorations(
int id)
override;
37 virtual const Affine3& currentModelTransform()
const override;
38 virtual const Matrix4& projectionMatrix()
const override;
40 const Matrix4& viewProjectionMatrix()
const;
41 Matrix4 modelViewMatrix()
const;
42 Matrix4 modelViewProjectionMatrix()
const;
43 virtual double projectedPixelSizeRatio(
const Vector3& position)
const override;
46 void popShaderProgram();
51 void dispatchToTransparentPhase(
53 const std::function<
void(
Referenced*
object,
const Affine3& modelTransform,
int id)>& renderingFunction);
55 virtual bool initializeGL()
override;
56 virtual void flushGL()
override;
57 virtual void clearGL()
override;
58 virtual void setDefaultFramebufferObject(
unsigned int id)
override;
59 virtual const std::string& glVendor()
const override;
60 virtual void setViewport(
int x,
int y,
int width,
int height)
override;
61 virtual void updateViewportInformation(
int x,
int y,
int width,
int height)
override;
63 virtual const Vector3& pickedPoint()
const override;
64 virtual const SgNodePath& pickedNodePath()
const override;
65 virtual bool isRenderingPickingImage()
const override;
67 virtual void setLightingMode(
LightingMode mode)
override;
70 virtual void clearShadows()
override;
71 virtual void enableShadowOfLight(
int index,
bool on)
override;
72 virtual void enableShadowAntiAliasing(
bool on)
override;
73 virtual void setDefaultSmoothShading(
bool on)
override;
74 virtual SgMaterial* defaultMaterial()
override;
75 virtual void enableTexture(
bool on)
override;
76 virtual void setDefaultPointSize(
double size)
override;
77 virtual void setDefaultLineWidth(
double width)
override;
78 virtual void showNormalVectors(
double length)
override;
79 virtual void requestToClearResources()
override;
80 virtual void enableUnusedResourceCheck(
bool on)
override;
81 virtual void setColor(
const Vector3f& color)
override;
82 virtual void setUpsideDown(
bool on)
override;
83 virtual void setBackFaceCullingMode(
int mode)
override;
84 virtual int backFaceCullingMode()
const override;
85 virtual void setBoundingBoxRenderingForLightweightRenderingGroupEnabled(
bool on)
override;
87 void setLowMemoryConsumptionMode(
bool on);
89 virtual void setPickingImageOutputEnabled(
bool on)
override;
90 virtual bool getPickingImage(
Image& out_image)
override;
92 virtual bool isShadowCastingAvailable()
const override;
97 virtual void doRender()
override;
98 virtual bool doPick(
int x,
int y)
override;