@@ -23,7 +23,7 @@ THE SOFTWARE.
23
23
24
24
#ifdef __APPLE__
25
25
#include < OpenCL/OpenCL.h>
26
- #define GLFW_INCLUDE_GL3
26
+ #define GLFW_INCLUDE_GLCOREARB
27
27
#define GLFW_NO_GLU
28
28
#include " GLFW/glfw3.h"
29
29
#elif WIN32
@@ -207,10 +207,6 @@ void Render(GLFWwindow* window)
207
207
208
208
glClear (GL_COLOR_BUFFER_BIT); CHECK_GL_ERROR;
209
209
glBindVertexArray (g_vao); CHECK_GL_ERROR;
210
- // glEnableClientState(GL_VERTEX_ARRAY);CHECK_GL_ERROR;
211
-
212
-
213
-
214
210
215
211
GLuint program = g_shader_manager->GetProgram (" ../App/GLSL/simple" );
216
212
glUseProgram (program); CHECK_GL_ERROR;
@@ -525,178 +521,6 @@ void OnKey(GLFWwindow* window, int key, int scancode, int action, int mods)
525
521
case GLFW_KEY_F3:
526
522
g_benchmark = action == GLFW_PRESS ? true : g_benchmark;
527
523
break ;
528
- case GLFW_KEY_F4:
529
- if (!g_interop)
530
- {
531
- std::ostringstream oss;
532
- oss << " aov_color" << g_num_samples << " .png" ;
533
- SaveFrameBuffer (oss.str (), &g_outputs[g_primary].fdata [0 ]);
534
- break ;
535
- }
536
- case GLFW_KEY_PAGE_DOWN:
537
- {
538
- if (action == GLFW_RELEASE)
539
- {
540
- ++g_num_bounces;
541
- for (int i = 0 ; i < g_cfgs.size (); ++i)
542
- {
543
- g_cfgs[i].renderer ->SetNumBounces (g_num_bounces);
544
- g_cfgs[i].renderer ->Clear (float3 (0 , 0 , 0 ), *g_outputs[i].output );
545
- }
546
- g_samplecount = 0 ;
547
- break ;
548
- }
549
- }
550
- case GLFW_KEY_PAGE_UP:
551
- {
552
- if (action == GLFW_RELEASE)
553
- {
554
- if (g_num_bounces > 1 )
555
- {
556
- --g_num_bounces;
557
- for (int i = 0 ; i < g_cfgs.size (); ++i)
558
- {
559
- g_cfgs[i].renderer ->SetNumBounces (g_num_bounces);
560
- g_cfgs[i].renderer ->Clear (float3 (0 , 0 , 0 ), *g_outputs[i].output );
561
- }
562
- g_samplecount = 0 ;
563
- }
564
- break ;
565
- }
566
- }
567
- default :
568
- break ;
569
- }
570
- }
571
-
572
-
573
- void OnLetterKey (unsigned char key, int x, int y)
574
- {
575
- switch (key)
576
- {
577
- case ' w' :
578
- {
579
- float focal_length = g_camera->GetFocalLength ();
580
- focal_length += 0 .001f ;
581
- g_camera->SetFocalLength (focal_length);
582
-
583
- for (int i = 0 ; i < g_cfgs.size (); ++i)
584
- {
585
- g_cfgs[i].renderer ->Clear (float3 (0 , 0 , 0 ), *g_outputs[i].output );
586
- }
587
-
588
- break ;
589
- }
590
-
591
- case ' s' :
592
- {
593
- float focal_length = g_camera->GetFocalLength ();
594
-
595
- if (focal_length > 0 .f )
596
- {
597
- focal_length -= 0 .001f ;
598
- g_camera->SetFocalLength (focal_length);
599
-
600
- for (int i = 0 ; i < g_cfgs.size (); ++i)
601
- {
602
- g_cfgs[i].renderer ->Clear (float3 (0 , 0 , 0 ), *g_outputs[i].output );
603
- }
604
- }
605
-
606
- break ;
607
- }
608
-
609
- case ' q' :
610
- {
611
-
612
- float aperture = g_camera->GetAperture ();
613
-
614
- if (aperture == 0 .f )
615
- {
616
- g_camera->SetAperture (0 .025f );
617
- }
618
- else
619
- {
620
- g_camera->SetAperture (0 .0f );
621
- }
622
-
623
- for (int i = 0 ; i < g_cfgs.size (); ++i)
624
- {
625
- g_cfgs[i].renderer ->Clear (float3 (0 , 0 , 0 ), *g_outputs[i].output );
626
- }
627
-
628
- break ;
629
- }
630
-
631
- case ' d' :
632
- {
633
- float aperture = g_camera->GetAperture ();
634
-
635
- if (aperture > 0 .f )
636
- {
637
- aperture -= 0 .001f ;
638
- g_camera->SetAperture (aperture);
639
-
640
- for (int i = 0 ; i < g_cfgs.size (); ++i)
641
- {
642
- g_cfgs[i].renderer ->Clear (float3 (0 , 0 , 0 ), *g_outputs[i].output );
643
- }
644
- }
645
-
646
- break ;
647
- }
648
-
649
- case ' a' :
650
- {
651
- float aperture = g_camera->GetAperture ();
652
-
653
- if (aperture < 0 .2f )
654
- {
655
- aperture += 0 .001f ;
656
- g_camera->SetAperture (aperture);
657
-
658
- for (int i = 0 ; i < g_cfgs.size (); ++i)
659
- {
660
- g_cfgs[i].renderer ->Clear (float3 (0 , 0 , 0 ), *g_outputs[i].output );
661
- }
662
- }
663
-
664
- break ;
665
- }
666
-
667
- case ' z' :
668
- {
669
- float focus_dist = g_camera->GetFocusDistance ();
670
-
671
- if (focus_dist > 0 .f )
672
- {
673
- focus_dist -= 0 .1f ;
674
- g_camera->SetFocusDistance (focus_dist);
675
-
676
- for (int i = 0 ; i < g_cfgs.size (); ++i)
677
- {
678
- g_cfgs[i].renderer ->Clear (float3 (0 , 0 , 0 ), *g_outputs[i].output );
679
- }
680
- }
681
-
682
- break ;
683
- }
684
-
685
- case ' x' :
686
- {
687
- float focus_dist = g_camera->GetFocusDistance ();
688
-
689
- focus_dist += 0 .1f ;
690
- g_camera->SetFocusDistance (focus_dist);
691
-
692
- for (int i = 0 ; i < g_cfgs.size (); ++i)
693
- {
694
- g_cfgs[i].renderer ->Clear (float3 (0 , 0 , 0 ), *g_outputs[i].output );
695
- }
696
-
697
- break ;
698
- }
699
-
700
524
default :
701
525
break ;
702
526
}
@@ -1135,7 +959,7 @@ int main(int argc, char * argv[])
1135
959
{
1136
960
std::unique_ptr<Baikal::Iterator> shape_iter (g_scene->CreateShapeIterator ());
1137
961
1138
- for (shape_iter ; shape_iter->IsValid (); shape_iter->Next ())
962
+ for (; shape_iter->IsValid (); shape_iter->Next ())
1139
963
{
1140
964
auto shape = shape_iter->ItemAs <Baikal::Shape const >();
1141
965
auto mesh = dynamic_cast <Baikal::Mesh const *>(shape);
0 commit comments