본문 바로가기

All66

[Unity] Lambert와 Blinn-Phong (쉐이더 스타트업) 둘의 상관 관계를 아는 것이 중요해보여서 정리 ChatGPT에 의하면 위와 같음 Lambert는 표면에서 모든 방향으로 반사광이 나간다는 것을 가정함, 입사광을 뒤집은 벡터와 표면 법선 벡터의 각도가 작을 수록 밝음을 이용한 쉐이더 방식 코드로 표현하면 saturate(dot(viewVec, normalVec))이다. Blinn-Phong은 여기서 좀 발전했는데, Lambert에 Blinn-Phong 공식을 더해 스페큘러를 추가하는 방식이다. 내가 보는 뷰 벡터로부터 반사된 방향에 조명이 있으면, 그 부분 하이라이트가 가장 높음을 가정함. 즉, 뷰의 반사 벡터(R)와 조명 벡터(L)를 내적하여 하이라이트 정도를 얻어낼 수 있음 ( R ㅇ L ) = 하이라이트 레벨 조명 벡터는 Lambert의 Lighti.. 2023. 2. 12.
[Unity] Lambert Shader 구현 (쉐이더 스타트업) 사용하는 구조체는 SurfaceOutput albedo, normal, emission 이거는 standard랑 똑같이 쓰면 되고, Specular, Gloss가 다르다. 그런데 Lambert에서 넣어봤자 변화는 없으며, 다른 BlinnPhong Shader를 쓸 때 쓰는 것임 Lambert Shader를 구현한 CG 프로그램 코드이다. CGPROGRAM // Lighting + Test, ambient 제거 #pragma surface surf Test noambient sampler2D _MainTex; sampler2D _BumpTex; struct Input { float2 uv_MainTex; float2 uv_BumpTex; }; void surf (Input IN, inout SurfaceO.. 2023. 2. 4.
[Unity] Standard Shader SurfaceOutputStandard (쉐이더 스타트업) https://docs.unity3d.com/Manual/shader-StandardShader.html Unity - Manual: Standard Shader Standard Shader The Unity Standard ShaderA program that runs on the GPU. More infoSee in Glossary is a built-in shader with a comprehensive set of features. It can be used to render “real-world” objects such as stone, wood, glass, plastic and metal, an docs.unity3d.com https://darkcatgame.tistory.com/11 Un.. 2023. 2. 4.
[자료] React 세팅하기 0. create-react-app https://create-react-app.dev/ Create React App Set up a modern web app by running one command. create-react-app.dev 1. 명령어 활용 위한 nodejs 설치 https://nodejs.org/ko/ Node.js Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. nodejs.org 2. 환경변수 확인 3. 폴더에 npx create-react-app (프로젝트 폴더명) 4. 생성된 프로젝트 폴더 내에서 npm start 수행 2022. 10. 30.