-
42. Light, Material_Global Shader
지난 시간에 구에다 텍스쳐를 붙이는 작업까지 끝내 봤다. 1. Shader의 World, View, Projection, Texture0, LightDir 등의 변수를 전역 변수처럼 사용하면 안 되는 이유와 대안과 오늘 작업 목표 지난 시간에 MeshRenderer를 맨 마지막에 작업을 해서 이런저런 기능들을 넣어 놨다. 쉐이더도 07. Normal.fx 에서 World, View, Projection, Texture0, LightDir을 받고 있고, 그거를 MeshRenderer::Update에서 설정을 해주고 있다. auto world = GetTransform()->GetWorldMatrix(); _shader->GetMatrix("World")->SetMatrix((float*)&world); _..
DirectX
2024. 2. 11.
-
16. SimpleMath 실습
사전 작업 Game.cpp에서 void Game::CreateGeometry() { // VertexData - CPU 메모리에 있는 거 // 1 3 // 0 2 { _vertices.resize(4); _vertices[0].position = Vec3(-0.5f, -0.5f, 0.f); _vertices[0].uv = Vec2(0.f, 1.f); // _vertices[0].color = Color(1.f, 0.f, 0.f, 1.f); _vertices[1].position = Vec3(-0.5f, 0.5f, 0.f); _vertices[1].uv = Vec2(0.f, 0.f); // _vertices[1].color = Color(1.f, 0.f, 0.f, 1.f); _vertices[2].posi..
DirectX
2023. 12. 29.