From Frederic Bouvier, "here is my proposal. It is supposed to be used like this :
osg::Camera* c = createCamera(); c->attach( osg::Camera::COLOR_BUFFER0, texture3d, 0, osg::Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER ); it works also for cubemap textures and 2d texture arrays "
This commit is contained in:
@@ -330,6 +330,8 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
|
||||
COLOR_BUFFER15 = COLOR_BUFFER0+15
|
||||
};
|
||||
|
||||
static const unsigned int FACE_CONTROLLED_BY_GEOMETRY_SHADER;
|
||||
|
||||
/** Attach a buffer with specified OpenGL internal format.*/
|
||||
void attach(BufferComponent buffer, GLenum internalFormat);
|
||||
|
||||
|
||||
@@ -157,6 +157,7 @@ namespace osg
|
||||
typedef void GL_APIENTRY TglFramebufferTexture1D(GLenum, GLenum, GLenum, GLuint, GLint);
|
||||
typedef void GL_APIENTRY TglFramebufferTexture2D(GLenum, GLenum, GLenum, GLuint, GLint);
|
||||
typedef void GL_APIENTRY TglFramebufferTexture3D(GLenum, GLenum, GLenum, GLuint, GLint, GLint);
|
||||
typedef void GL_APIENTRY TglFramebufferTexture(GLenum, GLenum, GLint, GLint);
|
||||
typedef void GL_APIENTRY TglFramebufferTextureLayer(GLenum, GLenum, GLuint, GLint, GLint);
|
||||
typedef void GL_APIENTRY TglFramebufferRenderbuffer(GLenum, GLenum, GLenum, GLuint);
|
||||
typedef void GL_APIENTRY TglGenerateMipmap(GLenum);
|
||||
@@ -176,6 +177,7 @@ namespace osg
|
||||
TglFramebufferTexture1D* glFramebufferTexture1D;
|
||||
TglFramebufferTexture2D* glFramebufferTexture2D;
|
||||
TglFramebufferTexture3D* glFramebufferTexture3D;
|
||||
TglFramebufferTexture* glFramebufferTexture;
|
||||
TglFramebufferTextureLayer* glFramebufferTextureLayer;
|
||||
TglFramebufferRenderbuffer* glFramebufferRenderbuffer;
|
||||
TglGenerateMipmap* glGenerateMipmap;
|
||||
|
||||
Reference in New Issue
Block a user