wrapped diffuse

반응형


Wrap이란 무었인가?
무었인가를 감싼다는 말인데 부드러운 반사를 표현하기 위해 빛이 비치는
반대 영역을 감싸주는 것을 말한다. (...ㅡㅡ;....맞나?) 

자세한 설명은 아래들 있다.
wrapped Diffuse
http://www.gamedevforever.com/150 
  http://cagetu.egloos.com/5621806

사실 욘석은 피부를 표현하고자 할 때 자주 사용하는데
http://blog.naver.com/PostView.nhn?blogId=edgerider&logNo=110148724540
이곳에 보면 피부(SSS)를 위해 wrapped lighting을 사용하는 예가 있다.

sss 만들기
http://chulin28ho.egloos.com/5591833



lighting만 테스트 하기 위해 specular은 빼고 테스트 해보자!!


// 1. default lambert

Output.mDiffuse = dot(-lightDir, worldNormal);

 


// 2. half lambert  

Output.mDiffuse = pow(dot(-lightDir, worldNormal) * 0.5 + 0.5, 4);

 

// 3. wrapped diffuse

// if magicNumber is 0, it same with lambert function 

float magicNmuber = 0.5; 

Output.mDiffuse = (dot(-lightDir, worldNormal) + magicNmuber) / (magicNmuber+1);



// 4. energy conserving wrapped diffuse

float magicV = 0.5;  

float NdotL = dot(-lightDir,worldNormal);

Output.mDiffuse = saturate( (NdotL+magicV ) / ((magicV +1)*(magicV +1))  ); 

 
 // 5. fake sss 1

float3 LightColor = float3(0.3, 0.0, 0.0);

float LightIntensity = 1.0;

float LambertLight = dot(-lightDir, worldNormal);

Output.mDiffuse = (pow(1.0 - LambertLight,2.0) * LightIntensity) * LightColor;    

Output.mDiffuse += LambertLight;

 

// 6. fake sss 2

float3 LightColor = float3(0.3, 0.0, 0.0);

float LightIntensity = 1.0;

float NdotL = dot(-lightDir, worldNormal);

Output.mDiffuse = (pow(dot(-lightDir, viewDir),4.0) * LightIntensity) * LightColor;    

Output.mDiffuse += NdotL;

 

// 7. fake sss 3

float3 LightColor = float3(0.3, 0.0, 0.0);

float3 DiffuseColor = float3(1.0,1.0,1.0);

float LightIntensity = 1.0;

float NdotL = dot(-lightDir, worldNormal);

Output.mDiffuse = (pow(dot(-lightDir, viewDir),4.0) * LightIntensity) * LightColor + LightColor; 
Output.mDiffuse = lerp(NdotL, Output.mDiffuse, Output.mDiffuse) * DiffuseColor;

 

// 8. fake sss4

float3 LightColor = float3(0.3, 0.0, 0.0);    

float NdotL = dot(-lightDir, worldNormal);

float TransmissionMask = 0.7;

float3 DiffuseColor = lerp(float3(NdotL,NdotL,NdotL), TransmissionMask, TransmissionMask);

Output.mDiffuse = LightColor * DiffuseColor + NdotL;

 
 

   
그냥 쭉 나열해 놓긴 했는데 뭘 쓰든 그냥 걍 맘에 드는걸로, 프로젝트에 맞는걸로,
입맞에 맞게 대충 고쳐쓰면 된다.
기본적인 내용은 다 똑같다.





참고자료
wrapped Diffuse
http://www.gamedevforever.com/150 
  http://cagetu.egloos.com/5621806
Energy-Conserving Wrapped Diffuse 
http://blog.stevemcauley.com/2011/12/03/energy-conserving-wrapped-diffuse/
 
 wrap Shading
  http://www.iro.umontreal.ca/~derek/publication8.html 
Energy Conservation In Game
http://www.rorydriscoll.com/2009/01/25/energy-conservation-in-games/
Diffuse Warping을 이용한 고급 셀 셰이딩
http://www.gamedevforever.com/272


Cinematic Character Lighting In Star
http://www.gdcvault.com/play/1014362/Cinematic-Character-Lighting-in-STAR
TERA에 사용된 렌더링 테크닉
-  http://www.slideshare.net/valhashi/2011-03-gametechtadptforpdf
구세대 엔진 신데렐라 만들기
http://www.slideshare.net/kokyoungseok/2-20009459
유니티 라이팅이 안이뻐요
http://ozlael.egloos.com/3999813
Oren-Nayar Reflectance Lighting Model
http://www.gamedevforever.com/93
SkinShader in Unity
http://wiki.unity3d.com/index.php?title=SkinShader

http://www.gamasutra.com/view/feature/2817/hemisphere_lighting_with_radiosity_.php

http://digitalerr0r.wordpress.com/2009/05/09/xna-shader-programming-tutorial-19-hemispheric-ambient-light/


http://www.slideshare.net/ozlael/deferred-rendering-case-study


http://http.developer.nvidia.com/GPUGems/gpugems_ch22.html

http://docs.unity3d.com/Documentation/Components/script-ColorCorrectionEffect.html

http://blog.naver.com/PostView.nhn?blogId=sorkelf&logNo=40146367692&redirect=Dlog&widgetTypeCall=true&topReferer=http%3A%2F%2Fblog.naver.com%2FPostView.nhn%3FblogId%3Dagebreak%26logNo%3D60149081175%26redirect%3DDlog%26widgetTypeCall%3Dtrue%26top

http://wiki.unity3d.com/index.php?title=SkinShader

http://http.developer.nvidia.com/GPUGems/gpugems_ch16.html

https://www.youtube.com/watch?v=XBTB17hcbio&feature=related

'정리요망' 카테고리의 다른 글

ddx와 ddy  (0) 2020.01.29
Texture LOD calculation (useful for atlasing)  (0) 2019.12.06
TAGS.

Comments