전체 글 119

DX sampler_state

1. 코드 Texture.hlsl 파일 생성 struct VertexInput { float4 position : POSITION0; float2 uv : TEXCOORD0; }; struct PixelInput { float4 position : SV_POSITION0; //SV : 중요한 정보라는 의미 float2 uv : TEXCOORD0; }; cbuffer transfrombuffer : register(b0) // 슬롯의 갯수 0 ~ 13 상수 버퍼는 무족건 16byte 단위 { matrix w; matrix v; matrix p; }; PixelInput VS(VertexInput input) { //행렬 곱 PixelInput output; output.position = mul(input..

DX Raterizer

1. 코드 Execute.cpp 파일 //Create World view Projection (공간) { D3DXMatrixIdentity(&world); //항등행열 만들어지는곳 D3DXMatrixIdentity(&view); D3DXMatrixIdentity(&projection); //가상으로 만들어지는 카메라(눈) ,왼손 좌표(LH) , 오른손(RH) //넣을 좌표, 눈의 위치, 바라볼 대상 D3DXMatrixLookAtLH(&view, &D3DXVECTOR3(0, 0, 0), &D3DXVECTOR3(0, 0, 1), &D3DXVECTOR3(0, 1, 0)); //원근, 직교 투영 2가지 방식이 존재 현재는 직교투영 (좌표계 설정) //넣을 좌표, 윈도우사이즈 x, y, 시야 0 , 1 D3DXM..

DX 공간 결합

1. 코드 Execute.cpp //Create World view Projection (공간) { D3DXMatrixIdentity(&world); //항등행열 만들어지는곳 D3DXMatrixIdentity(&view); D3DXMatrixIdentity(&projection); //가상으로 만들어지는 카메라(눈) ,왼손 좌표(LH) , 오른손(RH) //넣을 좌표, 눈의 위치, 바라볼 대상 D3DXMatrixLookAtLH(&view, &D3DXVECTOR3(0, 0, 0), &D3DXVECTOR3(0, 0, 1), &D3DXVECTOR3(0, 1, 0)); //원근, 직교 투영 2가지 방식이 존재 현재는 직교투영 //넣을 좌표, 윈도우사이즈 x, y, 시야 0 , 1 D3DXMatrixOrthoLH..

DX 공간 변환

1. 코드 Execute.cpp 파일 //Pixel Shader {. . . } //Create World view Projection (공간) { D3DXMatrixIdentity(&world); //항등행열 만들어지는곳 D3DXMatrixIdentity(&view); D3DXMatrixIdentity(&projection); //가상으로 만들어지는 카메라(눈) ,왼손 좌표(LH) , 오른손(RH) //넣을 좌표, 눈의 위치, 바라볼 대상 D3DXMatrixLookAtLH(&view, &D3DXVECTOR3(0, 0, 0), &D3DXVECTOR3(0, 0, 1), &D3DXVECTOR3(0, 1, 0)); //원근, 직교 투영 2가지 방식이 존재 현재는 직교투영 //넣을 좌표, 윈도우사이즈 x, y,..

DX Window 창에 연동

1. 코드 Graphics cpp 파일 Graphics.cpp 파일 #include "stdafx.h" #include "Graphics.h" void Graphics::Initialize() { //Swap Chin 정의 DXGI_SWAP_CHAIN_DESC desc; { ZeroMemory(&desc, sizeof(DXGI_SWAP_CHAIN_DESC)); desc.BufferDesc.Width = 0; desc.BufferDesc.Height = 0; desc.BufferDesc.RefreshRate.Numerator = 60; // 화면 주사율 (분자) desc.BufferDesc.RefreshRate.Denominator = 1; // 화면 주사율 (분모) 60초당 1 desc.BufferDes..

DX 초기화, 설정, 삭제

1. 코드 stdafx.h 파일 //windows #include #include //디버그 모드에서만 실행함, 프로그램이 실행 중에 중단 가능 (단원문) //STL #include //DirectX (추후 변경) #include #include #include //전처리 문법 #pragma comment(lib, "dxgi.lib") #pragma comment(lib, "d3d11.lib") #pragma comment(lib, "d3dcompiler.lib") typedef unsigned int uint; //Macro Function #define SAFE_DELETE(p) {if(p) {delete (p); (p) = nullptr;}} #define SAFE_DELETE_ARRAY(p) {i..

Window 화면 설정

1. 코드 stdafx.h 파일 //windows #include #include //디버그 모드에서만 실행함, 프로그램이 실행 중에 중단 가능 (단원문) stdafx.cpp 파일 #include "stdafx.h" Window.h 파일 #pragma once #include "stdafx.h" namespace Window { static HINSTANCE global_instance; static HWND global_handle; //메시지 처리기 (CALLBACK : 컴퓨터 내부에서 알아서 셋팅함) inline LRESULT CALLBACK WndProc ( HWND handle, UINT message, WPARAM wParam, LPARAM lParam ) { switch (message) {..