| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 |
- 언리얼 엔진
- Replication
- gameplay ability system
- 게임개발
- stride
- Unreal Engine
- linear regression
- ability task
- C++
- CTF
- gas
- unity
- widget
- 유니티
- attribute
- Multiplay
- os
- 언리얼엔진
- 보안
- gameplay tag
- 게임 개발
- photon fusion2
- listen server
- local prediction
- Aegis
- animation
- UI
- gameplay effect
- rpc
- MAC
- Today
- Total
목록전체 글 (645)
Replicated
지금까지 클래스가 정점 버퍼, 인덱스 버퍼, 셰이더, 텍스처를 직접 들고 Render()에서 직접 그렸음그걸 리소스(Mesh)와 컴포넌트(MeshRenderer)로 나눠서, 2D 파트의 구조로 다시 가져오는 단계 class Mesh : public ResourceBase{ void CreateQuad(); void CreateCube(); void CreateGrid(int32 sizeX, int32 sizeZ); void CreateSphere(); ... shared_ptr> _geometry; shared_ptr _vertexBuffer; shared_ptr _indexBuffer;};CreateSphere()를 예로 들면Geometry를 만들고GeometryHelper::CreateSphere로 ..
노말(법선)노멀은 표면의 한 점에서 표면에 수직으로 바깥을 가리키는 길이 1짜리 벡터조명 계산에서 "이 면이 어느 쪽을 보고 있는가"를 나타냄 struct VertexTextureNormalData{ Vec3 position = { 0, 0, 0 }; Vec2 uv = { 0, 0 }; Vec3 normal = { 0, 0, 0 };};이번엔 정점 형식이 위치, uv, normal 도형별 노멀노멀은 도형 자신의 좌표계 기준 도형노멀구v.normal = v.position; v.normal.Normalize(); 중심이 원점이라, 중심에서 표면 점으로 가는 방향이 곧 바깥 방향큐브면마다 고정. 앞면 (0, 0, −1), 윗면 (0, 1, 0) …격자(CreateGrid)모든 정점 (0, 1, 0). 평평한..
HeightMap이란픽셀 밝기를 높이로 쓰는 흑백 이미지이미지를 위에서 내려다본 지형 지도로 보고, 밝을수록 높은 곳, 어두울수록 낮은 곳으로 해석이미지의 픽셀 (x, z) ↔ 격자(CreateGrid)의 정점 (x, z)를 1:1로 대응. 그래서 격자도 이미지와 같은 해상도로 만든다 그냥 이미지의 밝기를 높이 데이터로 읽는 지형을 만드는 기법 중 하나 CPU에서 픽셀 읽기_heightMap = RESOURCES->Load(L"Height", L"..\\Resources\\Textures\\Terrain\\height.png");const DirectX::ScratchImage& info = _heightMap->GetInfo();uint8* pixelBuffer = info.GetPixels(); 정점..
Sampling - 텍스처에서 색을 읽는 규칙샘플러가 하는 일return Texture0.Sample(Sampler0, input.uv);PS에서 텍스처 색을 읽는 줄 Sample은 "텍스처 Texture0에서 uv 위치의 색을 샘플러 규칙대로 읽어라"샘플러(SamplerState)는 그 규칙을 담은 상태 객체. 크게 두가지를 정함Filter: uv가 텍셀(텍스처의 픽셀)과 텍셀 사이를 가리킬 때 색을 어떻게 섞을지Address: uv가 0~1 범위 밖일 때 어디를 읽을지샘플러는 텍스처처럼 셰이더의 s 슬롯에 연결 uv와 텍셀uv는 이미지 크기와 상관없이 0~1GPU는 uv × 텍스처 크기로 텍셀 위치를 계산. 이 값이 정확히 텍셀 중심에 떨어지는 일은 드물어서, 사이 값을 어떻게 처리할지 Filter가..
Geomtry void GeometryHelper::CreateCube(shared_ptr> geometry){ float w2 = 0.5f; float h2 = 0.5f; float d2 = 0.5f; vector vtx(24); // 앞면 vtx[0] = VertexTextureData{Vec3(-w2, -h2, -d2), Vec2(0.0f, 1.0f)}; vtx[1] = VertexTextureData{Vec3(-w2, +h2, -d2), Vec2(0.0f, 0.0f) }; vtx[2] = VertexTextureData{Vec3(+w2, +h2, -d2), Vec2(1.0f, 0.0f)}; vtx[3] = VertexTextureData{Vec3(+w2, -h2, -d2), Vec2(1.0f, 1..
_texture = RESOURCES->Load(L"Veigar", L"..\\Resources\\Textures\\veigar.jpg");로드하고 Texture2D Texture0; // t 슬롯 (상수 버퍼 아님)SamplerState Sampler0; // s 슬롯float4 PS(VertexOutput input) : SV_TARGET{ return Texture0.Sample(Sampler0, input.uv);}픽셀 쉐이더 void TextureDemo::Render(){ _shader->GetMatrix("World")->SetMatrix((float*)&_world); _shader->GetMatrix("View")->SetMatrix((float*)&Camera::S_MatV..
// Camera_camera = make_shared();_camera->GetOrAddTransform();_camera->AddComponent(make_shared());_camera->AddComponent(make_shared());_camera->GetTransform()->SetPosition(Vec3(0.f, 0.f, -2.f));카메라 게임오브젝트카메라도 트랜스폼을 가진 게임 오브젝트임카메라의 트랜스폼은 월드 좌표계에서 카메라가 어디에 있고 어느 방향을 보는지를 나타냄이 경우 월드 원점에서 z방향 -2만큼 놓은 것 Vec3 eyePosition = GetTransform()->GetPosition(); // 카메라 위치 (0, 0, -2)Vec3 focusPos..
matrix World;matrix View;matrix Projection;matrix는 HLSL에서 float4x4(4×4 float 행렬, 64바이트)와 같은 타입이렇게 함수 밖에 선언한 숫자형 변수는 컴파일러가 $Globals라는 상수 버퍼 하나로 자동으로 묶는다이 데모의 셰이더에는 상수 버퍼가 1개($Globals, 192바이트 = 64 × 3) VertexOutput VS(VertexInput input){ VertexOutput output; output.position = mul(input.position, World); output.position = mul(output.position, View); output.position = mul(output.position, Projection..
