Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ign-rendering6' into find_param
Browse files Browse the repository at this point in the history
iche033 authored Feb 8, 2022
2 parents 61bea32 + 50e8e1e commit fcb8392
Showing 2 changed files with 6 additions and 18 deletions.
18 changes: 3 additions & 15 deletions examples/waves/GlutWindow.cc
Original file line number Diff line number Diff line change
@@ -87,18 +87,6 @@ bool g_initContext = false;
GLXDrawable g_glutDrawable;
#endif

double g_offset = 0.0;

int g_seed[1] = {0};
float g_resolution[2] = {400, 200};
float g_color[3] = {1.0, 1.0, 1.0};
float g_adjustments[16] = {
0, 0, 0, 0.0005,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0
};

// view control variables
ir::RayQueryPtr g_rayQuery;
ir::OrbitViewController g_viewControl;
@@ -341,9 +329,9 @@ void initCamera(ir::CameraPtr _camera)
void initUniforms()
{
ir::NodePtr node = g_camera->Parent();
ir::VisualPtr sphere =
ir::VisualPtr waves =
std::dynamic_pointer_cast<ir::Visual>(node->ChildByName("waves"));
ir::MaterialPtr shader = sphere->Material();
ir::MaterialPtr shader = waves->Material();
if (!shader)
return;

@@ -372,7 +360,7 @@ void initUniforms()
(*g_vsParams)["bumpSpeed"].InitializeBuffer(2);
(*g_vsParams)["bumpSpeed"].UpdateBuffer(bumpSpeed);

float amplitude = 0.7f;
float amplitude = 3.0f;
float amplitudeV[3] = {0.6f * amplitude, 0.4f * amplitude, 0.3f * amplitude};
(*g_vsParams)["amplitude"].InitializeBuffer(3);
(*g_vsParams)["amplitude"].UpdateBuffer(amplitudeV);
6 changes: 3 additions & 3 deletions examples/waves/Main.cc
Original file line number Diff line number Diff line change
@@ -85,7 +85,7 @@ void buildScene(ScenePtr _scene, const std::string &_engineName)
shader->SetVertexShader(vertexShaderPath);
shader->SetFragmentShader(fragmentShaderPath);

// create box visual
// create waves visual
VisualPtr waves = _scene->CreateVisual("waves");
MeshDescriptor descriptor;
descriptor.meshName = common::joinPaths(RESOURCE_PATH, "mesh.dae");
@@ -100,11 +100,11 @@ void buildScene(ScenePtr _scene, const std::string &_engineName)

// create camera
CameraPtr camera = _scene->CreateCamera("camera");
camera->SetLocalPosition(0, 0.0, 0.5);
camera->SetLocalPosition(0, 0.0, 3.5);
camera->SetLocalRotation(0.0, 0.0, 0.0);
camera->SetImageWidth(800);
camera->SetImageHeight(600);
camera->SetAntiAliasing(2);
camera->SetAntiAliasing(4);
camera->SetAspectRatio(1.333);
camera->SetHFOV(IGN_PI / 2);
root->AddChild(camera);

0 comments on commit fcb8392

Please sign in to comment.