Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
astraw committed Oct 22, 2017
1 parent 9554e3b commit 2982a1b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
28 changes: 14 additions & 14 deletions src/ProjectCubemapToGeometryPass.cpp
Expand Up @@ -116,23 +116,23 @@ void ProjectCubemapToGeometryPass::create_output_texture() {

void ProjectCubemapToGeometryPass::setup_camera()
{
// clearing
_camera->setClearColor(osg::Vec4(0.0f,0.0f,0.0f,0.0f)); // clear black
_camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// clearing
_camera->setClearColor(osg::Vec4(0.0f,0.0f,0.0f,0.0f)); // clear black
_camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

// projection and view
_camera->setProjectionMatrix(osg::Matrix::ortho2D(0,1,0,1));
_camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
_camera->setViewMatrix(osg::Matrix::identity());
// projection and view
_camera->setProjectionMatrix(osg::Matrix::ortho2D(0,1,0,1));
_camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
_camera->setViewMatrix(osg::Matrix::identity());

// viewport
_camera->setViewport(0, 0, _tex_width+1, _tex_height);
// off by one error in the width? removes visible seam!
// viewport
_camera->setViewport(0, 0, _tex_width+1, _tex_height);
// off by one error in the width? removes visible seam!

_camera->setRenderOrder(osg::Camera::PRE_RENDER);
_camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
_camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);

// attach the output texture
// attach the output texture
_camera->attach(osg::Camera::COLOR_BUFFER, _out_texture.get(), 0);

}
Expand All @@ -157,10 +157,10 @@ osg::ref_ptr<osg::Program> ProjectCubemapToGeometryPass::set_shader(osg::ref_ptr
// use shaders to generate a texture
osg::ref_ptr<osg::Group> ProjectCubemapToGeometryPass::create_textured_geometry() const
{
osg::ref_ptr<osg::Group> top_group = new osg::Group;
osg::ref_ptr<osg::Group> top_group = new osg::Group;
top_group->addDescription("ProjectCubemapToGeometryPass textured geometry top node");

osg::ref_ptr<osg::Geode> geode = new osg::Geode;
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
osg::ref_ptr<osg::Geometry> this_geom = _geometry_parameters->make_geom();

// Force bounding box to be undefined, since we change vertex
Expand Down
2 changes: 0 additions & 2 deletions src/ProjectCubemapToGeometryPass.h
Expand Up @@ -27,7 +27,6 @@ class ProjectCubemapToGeometryPass: protected ResourceLoader {
void create_output_texture();
void setup_camera();
osg::ref_ptr<osg::Group> create_textured_geometry() const;
osg::ref_ptr<osg::Group> create_output_textured_quad();
osg::ref_ptr<osg::Program> set_shader(osg::ref_ptr<osg::StateSet> state_set,
std::string vert_filename,
std::string frag_filename) const;
Expand All @@ -43,7 +42,6 @@ class ProjectCubemapToGeometryPass: protected ResourceLoader {
osg::ref_ptr<osg::Group> _private_geometry;
osg::ref_ptr<osg::Group> _public_geometry;

osg::ref_ptr<osg::Group> _output_quad;
osg::ref_ptr<osg::Texture2D> _out_texture;
osg::ref_ptr<osg::Program> _program;
osg::ref_ptr<osg::StateSet> _state_set;
Expand Down

0 comments on commit 2982a1b

Please sign in to comment.