OpenGL 13

opengl spot,point 라이팅

// sb6.h 헤더 파일을 포함시킨다. #include #include #include #include #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" // sb6::application을 상속받는다. class my_application : public sb7::application { public: // 쉐이더 컴파일한다. GLuint compile_shader(const char* vs_filename, const char* fs_filename) { // 버텍스 쉐이더를 생성하고 컴파일한다. GLuint vertex_shader = sb7::shader::load(vs_filename, GL_VERTEX_SHADER); // 프래그먼트 쉐이더를..

opengl 2023.01.05

opengl 라이팅 Phong모델

// sb6.h 헤더 파일을 포함시킨다. #include #include #include #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" // sb6::application을 상속받는다. class my_application : public sb7::application { public: // 쉐이더 컴파일한다. // basic lighting shader GLuint compile_shader2(void) { // 버텍스 쉐이더를 생성하고 컴파일한다. GLuint vertex_shader = sb7::shader::load("basic_lighting_vs.glsl", GL_VERTEX_SHADER); // 프래그먼트 쉐이더를 생성하고 컴파일한다. G..

opengl 2023.01.05

opengl 텍스처 겹치기 / 컴파일 쉐이더, 텍스처로드 함수화

// sb6.h 헤더 파일을 포함시킨다. #include #include #include #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" // sb6::application을 상속받는다. class my_application : public sb7::application { public: // 쉐이더 컴파일한다. GLuint compile_shader(const char* vs_file, const char* fs_file) { // 버텍스 쉐이더를 생성하고 컴파일한다. GLuint vertex_shader = sb7::shader::load(vs_file, GL_VERTEX_SHADER); // 프래그먼트 쉐이더를 생성하고 컴파일한다. GLuint f..

opengl 2023.01.05

opengl 텍스처

// sb6.h 헤더 파일을 포함시킨다. #include #include #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" // sb6::application을 상속받는다. class my_application : public sb7::application { public: // 쉐이더 컴파일한다. GLuint compile_shaders(void) { GLuint vertex_shader; GLuint fragment_shader; GLuint program; // 버텍스 쉐이더 소스 코드 static const GLchar* vertex_shader_source[] = { "#version 430 core\n" "\n" "layout(location ..

opengl 2023.01.04

opengl 시점변환 원근투영 - opengl라이브러리

// sb6.h 헤더 파일을 포함시킨다. #include #include // sb6::application을 상속받는다. class my_application : public sb7::application { public: // 쉐이더 컴파일한다. GLuint compile_shaders(void) { GLuint vertex_shader; GLuint fragment_shader; GLuint program; // 버텍스 쉐이더 소스 코드 static const GLchar* vertex_shader_source[] = { "#version 430 core\n" "\n" "layout(location = 0) in vec3 pos;\n" "layout(location = 1) in vec3 color..

opengl 2022.09.06

opengl 시점변환 원근투영 - 하드코딩

//배경색 칠하기////////////////////////////////////////// // sb6.h 헤더 파일을 포함시킨다. #include #include //수학 함수 해더파일 sin,cos // sb6::application을 상속받는다. class my_application : public sb7::application { public: //쉐이더 컴파일 과정 GLuint compile_shaders(void) { //쉐이더 객체 생성 GLuint vertex_shader_pung; vertex_shader_pung = glCreateShader(GL_VERTEX_SHADER); GLuint fragment_shader_pung; fragment_shader_pung = glCreateS..

opengl 2022.09.06

opengl 바람개비 회전 - 유니폼 VBO 사용

//배경색 칠하기////////////////////////////////////////// // sb6.h 헤더 파일을 포함시킨다. #include #include //수학 함수 해더파일 sin,cos // sb6::application을 상속받는다. class my_application : public sb7::application { public: //쉐이더 컴파일 과정 // 렌더링 virtual 함수를 작성해서 오버라이딩한다. GLuint compile_shaders(void) { GLuint vertex_shader; GLuint fragment_shader; GLuint program; program = glCreateProgram(); const GLchar* vertex_shader_sou..

opengl 2022.09.06

opengl 바람개비 보간

//배경색 칠하기////////////////////////////////////////// // sb6.h 헤더 파일을 포함시킨다. #include #include //수학 함수 해더파일 sin,cos // sb6::application을 상속받는다. class my_application : public sb7::application { public: //쉐이더 컴파일 과정 // 렌더링 virtual 함수를 작성해서 오버라이딩한다. GLuint compile_shaders(void) { GLuint vertex_shader; vertex_shader = glCreateShader(GL_VERTEX_SHADER); //버텍스 쉐이더 생성 GLuint fragment_shader; fragment_shad..

opengl 2022.09.06

opengl 삼각형 보간

#include #include //수학 함수 해더파일 sin,cos // sb6::application을 상속받는다. class my_application : public sb7::application { public: //쉐이더 컴파일 과정 // 렌더링 virtual 함수를 작성해서 오버라이딩한다. GLuint compile_shaders(void) { GLuint vertex_shader; vertex_shader = glCreateShader(GL_VERTEX_SHADER); //버텍스 쉐이더 생성 GLuint fragment_shader; fragment_shader = glCreateShader(GL_FRAGMENT_SHADER); GLuint program; program = glCreate..

opengl 2022.08.25

opengl 삼각형 폴리곤 모드 - 테셀레이션, 지오메트리 쉐이더

#include #include //수학 함수 해더파일 sin,cos // sb6::application을 상속받는다. class my_application : public sb7::application { public: //쉐이더 컴파일 과정 // 렌더링 virtual 함수를 작성해서 오버라이딩한다. GLuint compile_shaders(void) { GLuint vertex_shader; vertex_shader = glCreateShader(GL_VERTEX_SHADER); //버텍스 쉐이더 생성 GLuint fragment_shader; fragment_shader = glCreateShader(GL_FRAGMENT_SHADER); GLuint TCS; TCS = glCreateShader(G..

opengl 2022.08.24