목록C++ (208)
응애맘마조
머터리얼에 대해 추가적인 설명이 있었습니다. 어제 너무 급해서 설명을 잘하지 못하고 넘어간 부분이 있었습니다.#include "stdafx.h" #include "Main.h" #include #pragma comment(lib, "shlwapi.lib")Main.cpp의 첫 부분입니다. shlwapi인데 경로를 조작할 때 사용하는 API입니다. 백슬래시나 확장자를 덧붙이면서 경로가 없으면 만들거나 이미 있으면 그 경로에 저장하는 API입니다.size_t tok = file.find_last_of("."); string filename = file.substr(0, tok); string checkPath = "../Contents/Texture/" + filename; if (!PathFileExist..
먼저 코드의 변경 사항이 있었습니다. shared_ptr material; class Material* material; 첫 번째 줄에서 shared_ptr을 두 번째 줄인 클래스로 바꿨습니다. 재질 또한 오브젝트마다 제각각 다른데 전부 공유를 해버리면 모든 오브젝트에서 똑같아지는 이유에서 클래스로 바꾸게 되었습니다. cbuffer VS_W : register(b0) { matrix World; } cbuffer VS_VP : register(b1) { matrix ViewProj; } cbuffer PS_ViewPos : register(b0) { float4 ViewPos; } cbuffer PS_Material : register(b1) { float4 Ka; float4 Kd; float4 Ks;..
머터리얼에 대해 강의를 했었습니다. 재료나 질감 같은 느낌을 나타낼 때 사용합니다. #pragma once class MaterialBuffer { public: Colorambient; Colordiffuse; Colorspecular; Coloremissive; floatshininess; floatopacity; float environment; floatshadow; }; class Material : public MaterialBuffer { static ID3D11Buffer* materialBuffer; public: static void CreateStaticMember(); static void DeleteStaticMember(); public: shared_ptrnormalMap; s..
외부로부터 파일을 불러오는 방식에 대해서 강의를 했습니다. #pragma once class Main : public Scene { private: Camera*Cam; Grid*grid; Actor*temp; public: Main(); ~Main(); void LoadMaterial(string file); virtual void Init() override; virtual void Release() override; virtual void Update() override; virtual void LateUpdate() override; virtual void Render() override; virtual void PreRender() override; virtual void ResizeScreen..
광원으로 빛을 비추는 코드에 대해서 했었습니다. #include "Common.hlsl" struct VertexInput { float4 Position : POSITION0; float4 Color : COLOR0; float4 Normal : NORMAL0; }; struct PixelInput { float4 Position : SV_POSITION; float4 Color : COLOR0; float4 Normal : NORMAL0; float3 wPosition : POSITION0; }; PixelInput VS(VertexInput input) { PixelInput output; output.Color = input.Color; output.Position = mul(input.Posit..