Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Real-time Global Illumination #2

Closed
Jin02 opened this issue Dec 23, 2015 · 15 comments
Closed

Real-time Global Illumination #2

Jin02 opened this issue Dec 23, 2015 · 15 comments
Assignees
Labels

Comments

@Jin02
Copy link
Owner

Jin02 commented Dec 23, 2015

Voxel Cone Tracing을 구현한다.

@Jin02 Jin02 self-assigned this Dec 23, 2015
@Jin02 Jin02 added the Accept label Dec 23, 2015
Jin02 added a commit that referenced this issue Dec 24, 2015
Jin02 added a commit that referenced this issue Dec 27, 2015
1. ComputeRoughnessLOD 제거
2. SpecularVCT의 Mipmap 계산 부분 정리함
3. 각종 코드 수정
4. 실질적인 VCT 호출 및 Output 작업
5. 간단하게 Metallic 처리 구현

#2
@Jin02
Copy link
Owner Author

Jin02 commented Dec 27, 2015

쉐이더 부분은 어느정도 다 구현한 것 같다.
문제는 구조가 엉킨게 많아 GI관련 cpp 코드를 전부 새로 짜야한다.

@Jin02 Jin02 mentioned this issue Dec 27, 2015
Closed
Jin02 added a commit that referenced this issue Dec 31, 2015
Jin02 added a commit that referenced this issue Dec 31, 2015
Jin02 added a commit that referenced this issue Dec 31, 2015
Jin02 added a commit that referenced this issue Dec 31, 2015
1. GetSourceMapUAV 추가
2. GetMipmapUAV 버그 수정
3. 쓸모 없는 주석 제거

#2
Jin02 added a commit that referenced this issue Dec 31, 2015
1. GIInfoCB에서 dimension과 maxCascade 합침. (ushort, ushort)
2. GIInfoCB에서 initWorldMinPos 제거
3. GIInfoCB에서 maxMipmapLevel 추가
4. GetDimension() 추가

#2
Jin02 added a commit that referenced this issue Dec 31, 2015
2. cameraCommonCB -> camMatConstBuffer

#2
Jin02 added a commit that referenced this issue Dec 31, 2015
Jin02 added a commit that referenced this issue Jan 3, 2016
Jin02 added a commit that referenced this issue Jan 7, 2016
Jin02 added a commit that referenced this issue Jan 9, 2016
Jin02 added a commit that referenced this issue Jan 9, 2016
Jin02 added a commit that referenced this issue Jan 9, 2016
1. 이름 변경
2. Initialize 구현

#2
Jin02 added a commit that referenced this issue Jan 9, 2016
Jin02 added a commit that referenced this issue Jan 9, 2016
Jin02 added a commit that referenced this issue Jan 9, 2016
Jin02 added a commit that referenced this issue Feb 2, 2016
…orldPosition을 사용하지 않고 함수 인자에서 cameraWorldPos를 받아와서 계산하도록 수정 #2
Jin02 added a commit that referenced this issue Feb 2, 2016
1. ToUint, ToFloat 추가
2. UintToFloat4 -> RGBA9UintColorToFloat4 로 이름 변경
3. Float4ToUint -> Float4ColorToUint로 이름 변경
4. 코드 정리

#2
Jin02 added a commit that referenced this issue Feb 2, 2016
1. DynamicLighting.h를 포함하지 않도록 함
2. StoreVoxelMapAtomicColorAvg 추가.
   - StoreVoxelMapAtomicColorMax는 그냥 들어오는 값을 계산 더해서 최종적으로 float4(1.0f, 1.0f, 1.0f, 1.0f)가 목적인 반면, 이건 그냥 들어오는 모든 값을 평균내준다. Novus Engine 참고함

#2
@Jin02
Copy link
Owner Author

Jin02 commented Feb 5, 2016

AlbedoTest
Albedo Test

NormalTest
Normal Test

InjectionTest
Injection Test

버그를 잡기 위해 복셀들을 모두 시각화처리를 하였다.

@Jin02
Copy link
Owner Author

Jin02 commented Feb 8, 2016

AnisotropicInjection
Anisotropic Injection Test

AnisotropicMipmap
Mipmap Test

다시 6면을 사용했다 -_-..
대신 GPU 메모리 문제로 인해 최대 해상도가 128x128x128 이 한계이다.
그림자를 제외하고 드문 드문 검은색으로 복셀이 칠해져 있는 부분이 있는데 이건 Bloating 처리를 해야 해결 될 문제일 듯 싶다.

그나저나 확실히 시각화 처리를 하니까 버그잡기가 정말 수월하구나..

Jin02 added a commit that referenced this issue Feb 11, 2016
1. DiffuseVCT에서 coneDir 계산하는 방식 개선
2. 테스트를 위해 DiffuseVCT를 제외한 다른 기능 실행시키지 않도록 함

#2
@Jin02
Copy link
Owner Author

Jin02 commented Feb 14, 2016

DiffuseTest
ddiffuse 테스트

indirect diffuse만 출력한 상태이다.
아직 썩.. 결과물이 맘에 들진 않는다

해상도를 낮춰서 테스트하고 있는데 그래픽 카드가 계속 부들부들거려서 불안하다;
소음 소리만 들어봐도 비행기가 곧 이륙할거 같다

@Jin02
Copy link
Owner Author

Jin02 commented Feb 15, 2016

InterlockedCompareExchange 이게 문제가 있는 것 같다.
뭐, 그거 뿐만이 아니더라도 현재 구현된 StoreVoxelMapAtomicColor들은 전부 제대로 돌아가지 않는 상태이다.

GL4의 imageAtomicCompSwap같은 효과를 가진 기능을 찾아야 하는데 보이지가 않는다..

@Jin02
Copy link
Owner Author

Jin02 commented Feb 15, 2016

Metallic3

현재 개발 환경에 사용중인 놋북이 5~6년전에 발매되었고, 그래픽 드라이버 업데이트가 불가능해서, Interlocked 관련 기능이 제대로 굴러가리란 보장을 못하겠다.

특히 매 프레임마다 복셀화 처리 및 인젝션 처리를 하려고 하니,
뭔가 제대로 계산이 되지 않는지 위의 사진에서 보이지도 않는 알 수 없는 색이(주로 파란색)이 섞여서 나오거나 화면이 자주 깜빡거렸다. 간헐적으로 그래픽 카드 다운되서 화면이 나가는건 덤;

그래서 그냥 VCT까지 단 한 프레임만 렌더링하고 했더니 위처럼 어느 정도 잘뜬다..
후......

위의 사진은 metallic 0.3에 diffuse만 되어 있는 모습이다.
그림자는 underScaneSize를 변경해줘야 하는데 귀찮다.

@Jin02
Copy link
Owner Author

Jin02 commented Feb 15, 2016

roughnesshigh
Roughness가 높을 때

roughnesslow
Roughness가 낮을 때

뭐.. Specular는 glossy하게 이런식으로 나온다.
Roughness가 높을 때 나오는 푸른색은 위의 코멘트와 같이 이유를 전혀 알 수 없다.
걍 하드웨어 에러겠지 -_- 논리적으로도 수식적으로도 저게 뜰리가 없는데 뜬다는거면..

이제 이거랑 diffuse랑 잘 섞으면 될 것 같다..

@Jin02
Copy link
Owner Author

Jin02 commented Feb 15, 2016

Metallic03
Diffuse + Specular, Metallic이 0.7일때의 모습.

음.. 괜찮게 된게 맞긴 한가?

@Jin02
Copy link
Owner Author

Jin02 commented Feb 16, 2016

uav를 이용하여 텍스쳐 atomic 연산을 처리할 때, while과 for는 정상적으로 작동이 되지 않는다.
이유는 모르겠다.

do-while이 그나마 어느정도 작동은 하는 것 같다만, 이것도 정상적으로 잘 작동하진 않는다.
그러니깐, 값이 너무 가끔씩 들어간다. 모든 값이 전부 계산되지 않는다고 생각하면 된다.

답답한게, 구글링해봐도 나만 그런게 아니고 여러 사람들이 드문드문 겪는 문제인듯하다.
뭐 누군 do-while이 안되고 while이 되지만 둘 다 되는 사람도 있고.. 뭐 답이 없다. 그래픽카드 문제라니;

그리고 난 왜 둘 다 안되는건가..
후 -_-..

Jin02 added a commit that referenced this issue Feb 16, 2016
@Jin02
Copy link
Owner Author

Jin02 commented Feb 16, 2016

WTF
위의 사진은 https://github.com/Jin02/SOCEngine/blob/%232/SOCEngine/SOCEngine/ShaderCodes/GICommon.h#L100 에서 StoreVoxelMapAtomicColorAvgNibble을 Voxelization에서 사용한 모습. Metallic은 0.9이다. 뒤의 반사되는 모습을 본다면 위의 모습보다 훨씬 정확한 결과물이다. 그런데 정작 작성해서 사용하고 있는 함수는 정상이 아니라서.. 문제가 된다.

StoreVoxelMapAtomicColorAvgNibble의 모습을 보면 알겠지만, 이건 정상적으로 작동하는 함수가 아니다. 근데 결과물은 가장 제대로 뜬다 -_-..

atomic연산을 하지 않고 복셀 텍스쳐에 값을 직접넣어도 잘 작동이 안되고,
StoreVoxelMapAtomicColorAvg를 사용해도 잘 작동이 되지 않는게 왜 Nibble에서는 되는건지 모르겠다.

이제는 개발환경을 바꿔봐야하나 싶다..
뭐.. gt540m에 그래픽 드라이버 업데이트가 불가능한 환경이니(업데이트하면 드라이버가 인식을 못함) 이런 버그가 뜨는게 당연하다고 생각해야나..

그냥 다 포기하고 GL을 선택하고 싶어도 현재 개발환경이 GL4를 지원하지 않는다.

Jin02 added a commit that referenced this issue Feb 17, 2016
@Jin02 Jin02 added Done and removed Accept labels Feb 17, 2016
@Jin02
Copy link
Owner Author

Jin02 commented Feb 17, 2016

#7 에 남은 이슈들이 있다.

@Jin02 Jin02 closed this as completed Feb 17, 2016
Jin02 added a commit that referenced this issue Jul 24, 2016
애매한 wrap보단 clamp가 더 정확할 것 같다.
wrap은 나중에 필요할때 만들어서 넣어주면 된다. #2
@Jin02
Copy link
Owner Author

Jin02 commented Sep 9, 2018

This issue was moved to TeamSOC/SOCEngine#3

@Jin02
Copy link
Owner Author

Jin02 commented Sep 9, 2018

This issue was moved to TeamSOC/SOCEngine#2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant