void ProceduralTerrain::FlushTerrainData() { RenderFactory& rf = Context::Instance().RenderFactoryInstance(); RenderEngine& re = rf.RenderEngineInstance(); int3 octaves(ridge_octaves_, fBm_octaves_, tex_twist_octaves_); height_pp_->SetParam(0, octaves); height_pp_->SetParam(1, texture_world_offset_); height_pp_->SetParam(2, float2(static_cast<float>(world_uv_repeats_), 1.0f / world_uv_repeats_)); mask_pp_->SetParam(0, texture_world_offset_); mask_pp_->SetParam(1, world_scale_ * tile_rings_.back()->OuterWidth() / COARSE_HEIGHT_MAP_SIZE); mask_pp_->SetParam(2, float2(static_cast<float>(world_uv_repeats_), 1.0f / world_uv_repeats_)); mask_pp_->SetParam(3, float2(vertical_scale_, 1.0f / vertical_scale_)); FrameBufferPtr fb = re.CurFrameBuffer(); height_pp_->Apply(); gradient_pp_->Apply(); //mask_pp_->Apply(); re.BindFrameBuffer(fb); height_map_tex_->CopyToTexture(*height_map_cpu_tex_); //SaveTexture(height_map_cpu_tex_, "height_map.dds"); //SaveTexture(gradient_map_tex_, "gradient_map.dds"); //SaveTexture(mask_map_tex_, "mask_map.dds"); }
std::string SiftDetectorConfig::toString() const { std::stringstream configString; configString << "Best features: " << bestFeatures() << std::endl << "Octaves: " << octaves() << std::endl << "Contrast threshold: " << contrastThresh() << std::endl << "Edge threshold: " << edgeThresh() << std::endl << "Sigma: " << sigma() << std::endl; return configString.str(); }