Skip to content

Commit

Permalink
Merge branch 'release/v0.7.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
bernstein committed May 26, 2014
2 parents 7731e88 + 30a1af0 commit c5ad846
Show file tree
Hide file tree
Showing 13 changed files with 153 additions and 146 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PROJECT(GUACAMOLE CXX)
# version number
set(GUACAMOLE_MAJOR 0)
set(GUACAMOLE_MINOR 7)
set(GUACAMOLE_PATCH 1)
set(GUACAMOLE_PATCH 2)
set(GUACAMOLE_VERSION ${GUACAMOLE_MAJOR}.${GUACAMOLE_MINOR}.${GUACAMOLE_PATCH})
set(GUACAMOLE_DESCRIPTION "GUACAMOLE - an astonishing virtual reality engine")
set(GUACAMOLE_HOMEPAGE "http://www.GUACAMOLE.org")
Expand Down
5 changes: 3 additions & 2 deletions include/gua/renderer/GBufferPass.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ class GBufferPass : public GeometryPass {
CameraMode eye,
std::size_t viewid);

void update_ubershader_from_scene(SerializedScene const& scene,
void update_ubershader_from_scene(RenderContext const& ctx,
SerializedScene const& scene,
SceneGraph const& graph);

void initialize_state_objects(RenderContext const& ctx);
Expand All @@ -101,7 +102,7 @@ class GBufferPass : public GeometryPass {
std::unordered_map<std::type_index, GeometryUberShader*> ubershaders_;

/**
* copy of all material names in scene
* copy of all material names in scene
*
* - necessary to generate gbuffermappings of ubershaders
*/
Expand Down
4 changes: 2 additions & 2 deletions include/gua/renderer/NURBSUberShader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ namespace gua {
*/
class NURBSUberShader : public GeometryUberShader {

public : // typedefs, enums
public : // typedefs, enums

enum pass {
transform_feedback_pass = 0,
final_pass = 1
};

public :
public :

/*virtual*/ void create (std::set<std::string> const& material_names);

Expand Down
6 changes: 3 additions & 3 deletions include/gua/renderer/UberShader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class UberShader {
{
UniformValue<T> tmp(value);

for (auto const& program : programs_) {
for (auto const& program : programs_) {

program->apply_uniform(context, &tmp, name, position);
}
Expand All @@ -104,13 +104,13 @@ class UberShader {
std::string const& name) const;

/**
* returns a program in enumerated order
* returns a program in enumerated order
*/
virtual std::shared_ptr<ShaderProgram> const& get_program(unsigned index = 0) const;

/**
* returns a container with all involved programs of this ubershader
*/
*/
std::vector<std::shared_ptr<ShaderProgram>> const& programs() const;

/**
Expand Down
8 changes: 4 additions & 4 deletions include/gua/renderer/Video3DUberShader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class GUA_DLL Video3DUberShader : public GeometryUberShader {
void create(std::set<std::string> const& material_names);

/*virtual*/ bool upload_to(RenderContext const& context) const;

/*virtual*/ stage_mask const get_stage_mask() const;

/*virtual*/ void preframe(RenderContext const& context) const;
Expand Down Expand Up @@ -94,7 +94,7 @@ class GUA_DLL Video3DUberShader : public GeometryUberShader {

std::string const _blend_pass_vertex_shader () const;
std::string const _blend_pass_fragment_shader () const;

private: // attributes

static const unsigned MAX_NUM_KINECTS = 6;
Expand All @@ -106,14 +106,14 @@ class GUA_DLL Video3DUberShader : public GeometryUberShader {
mutable std::vector<scm::gl::rasterizer_state_ptr> no_bfc_rasterizer_state_;
mutable std::vector<scm::gl::sampler_state_ptr> nearest_sampler_state_;
mutable std::vector<scm::gl::sampler_state_ptr> linear_sampler_state_;

mutable std::vector<scm::gl::depth_stencil_state_ptr> depth_stencil_state_warp_pass_;
mutable std::vector<scm::gl::depth_stencil_state_ptr> depth_stencil_state_blend_pass_;

mutable std::vector<scm::gl::quad_geometry_ptr> fullscreen_quad_;
mutable std::vector<scm::gl::quad_geometry_ptr> fullscreen_quad2_;


};

}
Expand Down
1 change: 0 additions & 1 deletion src/gua/databases/MaterialDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ void MaterialDatabase::load_material(std::string const& filename) {
if (!instance()->is_supported(filename)) {
auto mat = std::make_shared<Material>(filename, filename);
instance()->add(filename, mat);
Logger::LOG_MESSAGE << "MaterialDatabase::load_material() : loading " << filename << std::endl;
}
}

Expand Down
9 changes: 6 additions & 3 deletions src/gua/renderer/GBufferPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void GBufferPass::rendering(SerializedScene const& scene,
ctx.render_context->set_depth_stencil_state(depth_stencil_state_);

// make sure all ubershaders are available
update_ubershader_from_scene(scene, graph);
update_ubershader_from_scene(ctx, scene, graph);

// draw all drawable geometries
for (auto const& type_ressource_pair : scene.geometrynodes_) {
Expand Down Expand Up @@ -310,7 +310,7 @@ void GBufferPass::display_rays(RenderContext const& ctx,
for (auto const& ray : scene.rays_) {
meshubershader->draw(
ctx,
"gua_plane_geometry",
"gua_ray_geometry",
"gua_bounding_box",
ray->get_cached_world_transform(),
scm::math::inverse(ray->get_cached_world_transform()),
Expand Down Expand Up @@ -380,7 +380,8 @@ void GBufferPass::display_quads(RenderContext const& ctx,

////////////////////////////////////////////////////////////////////////////////

void GBufferPass::update_ubershader_from_scene(SerializedScene const& scene,
void GBufferPass::update_ubershader_from_scene(RenderContext const& ctx,
SerializedScene const& scene,
SceneGraph const& graph) {
bool ubershader_available = true;
for (auto const& geometry_pair : scene.geometrynodes_) {
Expand All @@ -398,6 +399,7 @@ void GBufferPass::update_ubershader_from_scene(SerializedScene const& scene,
GeometryDatabase::instance()->lookup(geode->get_filename());
if (ressource) {
auto ubershader = ressource->get_ubershader();
ubershader->cleanup(ctx);
ubershader->create(materials_);
ubershaders_[type] = ubershader;
}
Expand Down Expand Up @@ -441,6 +443,7 @@ void GBufferPass::apply_material_mapping(
std::set<std::string> const& materials) {
materials_ = materials;
Singleton<TriMeshUberShader>::instance()->create(materials_);
// Singleton<TriMeshUberShader>::instance();
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
Loading

0 comments on commit c5ad846

Please sign in to comment.