<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>light Archives - 어제와 내일의 나 그 사이의 이야기</title>
	<atom:link href="https://lycos7560.com/tag/light/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>생각의 흐름을 타고 다니며 만드는 블로그</description>
	<lastBuildDate>Sat, 16 Mar 2024 21:43:13 +0000</lastBuildDate>
	<language>ko-KR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://lycos7560.com/wp-content/uploads/2022/11/cropped-cropped-cropped-log-1-150x150-1-80x80.png</url>
	<title>light Archives - 어제와 내일의 나 그 사이의 이야기</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>환경 조명, 환경광 (Ambient Light)</title>
		<link>https://lycos7560.com/etc/%ed%99%98%ea%b2%bd-%ec%a1%b0%eb%aa%85-%ed%99%98%ea%b2%bd%ea%b4%91-ambient-light/37974/</link>
					<comments>https://lycos7560.com/etc/%ed%99%98%ea%b2%bd-%ec%a1%b0%eb%aa%85-%ed%99%98%ea%b2%bd%ea%b4%91-ambient-light/37974/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Sat, 17 Feb 2024 21:43:01 +0000</pubDate>
				<category><![CDATA[개인 공부 저장용]]></category>
		<category><![CDATA[기타]]></category>
		<category><![CDATA[Ambient]]></category>
		<category><![CDATA[Ambient Light]]></category>
		<category><![CDATA[light]]></category>
		<category><![CDATA[환경 조명]]></category>
		<category><![CDATA[환경광]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=37974</guid>

					<description><![CDATA[<p>환경 조명, 환경광 (Ambient Light) 주변에서 발생하는 자연광이나 인공광 등으로, 특정 방향이나 원래 빛을 색출하지 않고 모든 방향으로 일정하게 퍼져나가는 빛을 의미합니다. 이는 주로 주변 환경에서 반사된 빛이나 다른 광원에서의 산란된 빛으로 구성됩니다. 주변광은 환경의 전반적인 밝기를 높이고 물체를 더 잘 보이게 만들어줍니다. 예를 들어, 방 안에 있는 전체적인 조명이나 창문을 통해 들어오는 자연광은 주변광의 [&#8230;]</p>
<p>The post <a href="https://lycos7560.com/etc/%ed%99%98%ea%b2%bd-%ec%a1%b0%eb%aa%85-%ed%99%98%ea%b2%bd%ea%b4%91-ambient-light/37974/">환경 조명, 환경광 (Ambient Light)</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5698326622209671"
     data-ad-slot="5078714126"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph"><strong>환경 조명, 환경광 (Ambient Light)</strong></p>



<p class="wp-block-paragraph">주변에서 발생하는 <strong>자연광이나 인공광 등으로, 특정 방향이나 원래 빛을 색출하지 않고 모든 방향으로 일정하게 퍼져나가는 빛을 의미</strong>합니다. </p>



<p class="wp-block-paragraph">이는 주로<strong> 주변 환경에서 반사된 빛이나 다른 광원에서의 산란된 빛으로 구성됩니다.</strong></p>



<p class="wp-block-paragraph">주변광은 환경의 전반적인 밝기를 높이고 물체를 더 잘 보이게 만들어줍니다. </p>



<p class="wp-block-paragraph">예를 들어, 방 안에 있는 전체적인 조명이나 창문을 통해 들어오는 자연광은 주변광의 한 예입니다. </p>



<p class="wp-block-paragraph">이러한 주변광은 빛이 특정 방향에서 집중되는 것이 아니라 주변 공간을 채우는 형태로 존재합니다.</p>



<p class="wp-block-paragraph">주변광은 주로 조명 설계에서 중요한 역할을 합니다. </p>



<p class="wp-block-paragraph">물체에 직접적인 조명을 가하는 것 외에도 주변광을 적절히 활용함으로써 물체의 형태와 특징을 부각시키고 환경을 더 밝고 쾌적하게 만들 수 있습니다. </p>



<p class="wp-block-paragraph">또한 3D 그래픽 디자인이나 가상 현실(VR) 등의 분야에서는 주변광을 사용하여 현실적인 조명 효과를 시뮬레이션하거나 공간을 더 자연스럽게 표현할 수 있습니다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-7387b849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1055" height="700" src="https://lycos7560.com/wp-content/uploads/2024/03/image-7.jpg" alt="" class="wp-image-37975" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-7.jpg 1055w, https://lycos7560.com/wp-content/uploads/2024/03/image-7-300x199.jpg 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-7-768x510.jpg 768w" sizes="(max-width: 1055px) 100vw, 1055px" /><figcaption class="wp-element-caption"><a href="https://www.rothschildphotography.com/ambient-light" target="_blank" rel="noreferrer noopener">https://www.rothschildphotography.com/ambient-light</a></figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="1054" height="699" src="https://lycos7560.com/wp-content/uploads/2024/03/image-7-1.jpg" alt="" class="wp-image-37976" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-7-1.jpg 1054w, https://lycos7560.com/wp-content/uploads/2024/03/image-7-1-300x199.jpg 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-7-1-768x509.jpg 768w" sizes="(max-width: 1054px) 100vw, 1054px" /><figcaption class="wp-element-caption"><a href="https://www.rothschildphotography.com/ambient-light" target="_blank" rel="noreferrer noopener">https://www.rothschildphotography.com/ambient-light</a></figcaption></figure>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-7387b849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="1053" height="698" src="https://lycos7560.com/wp-content/uploads/2024/03/image-7.png" alt="" class="wp-image-37977" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-7.png 1053w, https://lycos7560.com/wp-content/uploads/2024/03/image-7-300x199.png 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-7-768x509.png 768w" sizes="(max-width: 1053px) 100vw, 1053px" /><figcaption class="wp-element-caption"><a href="https://www.rothschildphotography.com/ambient-light" target="_blank" rel="noreferrer noopener">https://www.rothschildphotography.com/ambient-light</a></figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="1055" height="704" src="https://lycos7560.com/wp-content/uploads/2024/03/image-8.jpg" alt="" class="wp-image-37978" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-8.jpg 1055w, https://lycos7560.com/wp-content/uploads/2024/03/image-8-300x200.jpg 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-8-768x512.jpg 768w" sizes="(max-width: 1055px) 100vw, 1055px" /><figcaption class="wp-element-caption"><a href="https://www.rothschildphotography.com/ambient-light" target="_blank" rel="noreferrer noopener">https://www.rothschildphotography.com/ambient-light</a></figcaption></figure>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-7387b849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="732" height="333" src="https://lycos7560.com/wp-content/uploads/2024/03/image-9.png" alt="" class="wp-image-37980" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-9.png 732w, https://lycos7560.com/wp-content/uploads/2024/03/image-9-300x136.png 300w" sizes="(max-width: 732px) 100vw, 732px" /><figcaption class="wp-element-caption"><a href="https://medium.com/@EightyLevel/7-tips-for-better-lighting-in-unity-686694892ece" target="_blank" rel="noreferrer noopener">https://medium.com/@EightyLevel/7-tips-for-better-lighting-in-unity-686694892ece</a></figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="835" height="412" src="https://lycos7560.com/wp-content/uploads/2024/03/image-10.jpg" alt="" class="wp-image-37981" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-10.jpg 835w, https://lycos7560.com/wp-content/uploads/2024/03/image-10-300x148.jpg 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-10-768x379.jpg 768w" sizes="(max-width: 835px) 100vw, 835px" /><figcaption class="wp-element-caption"><a href="https://www.loxone.com/enen/products/lighting-products/ambient-lighting/" target="_blank" rel="noreferrer noopener">https://www.loxone.com/enen/products/lighting-products/ambient-lighting/</a></figcaption></figure>
</div>
</div>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block"
     data-ad-format="autorelaxed"
     data-ad-client="ca-pub-5698326622209671"
     data-ad-slot="4386247858"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
<p>The post <a href="https://lycos7560.com/etc/%ed%99%98%ea%b2%bd-%ec%a1%b0%eb%aa%85-%ed%99%98%ea%b2%bd%ea%b4%91-ambient-light/37974/">환경 조명, 환경광 (Ambient Light)</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/etc/%ed%99%98%ea%b2%bd-%ec%a1%b0%eb%aa%85-%ed%99%98%ea%b2%bd%ea%b4%91-ambient-light/37974/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>빛의 성질 &#8211; 요약</title>
		<link>https://lycos7560.com/etc/%eb%b9%9b%ec%9d%98-%ec%84%b1%ec%a7%88-%ec%9a%94%ec%95%bd/37972/</link>
					<comments>https://lycos7560.com/etc/%eb%b9%9b%ec%9d%98-%ec%84%b1%ec%a7%88-%ec%9a%94%ec%95%bd/37972/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Fri, 16 Feb 2024 21:17:29 +0000</pubDate>
				<category><![CDATA[개인 공부 저장용]]></category>
		<category><![CDATA[기타]]></category>
		<category><![CDATA[Absorption]]></category>
		<category><![CDATA[Interference]]></category>
		<category><![CDATA[light]]></category>
		<category><![CDATA[Reflection]]></category>
		<category><![CDATA[Refraction]]></category>
		<category><![CDATA[Scattering]]></category>
		<category><![CDATA[Shader]]></category>
		<category><![CDATA[the nature of light]]></category>
		<category><![CDATA[Transmission]]></category>
		<category><![CDATA[URP]]></category>
		<category><![CDATA[간섭]]></category>
		<category><![CDATA[간섭(Interference)]]></category>
		<category><![CDATA[굴절]]></category>
		<category><![CDATA[굴절(Refraction)]]></category>
		<category><![CDATA[그래픽]]></category>
		<category><![CDATA[반사]]></category>
		<category><![CDATA[반사(Reflection)]]></category>
		<category><![CDATA[빛의 성질]]></category>
		<category><![CDATA[산란]]></category>
		<category><![CDATA[산란(Scattering)]]></category>
		<category><![CDATA[쉐이더]]></category>
		<category><![CDATA[요약]]></category>
		<category><![CDATA[투과]]></category>
		<category><![CDATA[투과(Transmission)]]></category>
		<category><![CDATA[파동]]></category>
		<category><![CDATA[파장]]></category>
		<category><![CDATA[회절]]></category>
		<category><![CDATA[회절(Refraction)]]></category>
		<category><![CDATA[흡수]]></category>
		<category><![CDATA[흡수(Absorption)]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=37972</guid>

					<description><![CDATA[<p>빛의 성질 빛은 여러가지 성질을 가지고 있다. 가장 대표적인 성질은 직진하는 성질이다. 매질이 없는 진공 또는 투명한 매질을 통과할 경우 직진한다. 빛이 다른 무언가와 부딪치면 정반사(Specular Reflection) / 난반사(Diffuse Reflection) &#8211; 반사(Reflection) 굴절(Refraction)과 투과(Transmission) 굴절(Refraction) 물체를 통과하는 빛은 일반적으로 직선으로 이동하는 것이 아니라, 물체의 경계면을 통과할 때 굴절(Refraction) 현상이 일어납니다. 위와 같은 현상은 빛이 한 [&#8230;]</p>
<p>The post <a href="https://lycos7560.com/etc/%eb%b9%9b%ec%9d%98-%ec%84%b1%ec%a7%88-%ec%9a%94%ec%95%bd/37972/">빛의 성질 &#8211; 요약</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5698326622209671"
     data-ad-slot="5078714126"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-7387b849 wp-block-columns-is-layout-flex" style="border-width:1px">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-uagb-advanced-heading uagb-block-afcbccbb"><h2 class="uagb-heading-text">빛의 성질</h2></div>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--50);margin-bottom:var(--wp--preset--spacing--50)"/>



<p class="wp-block-paragraph">빛은 여러가지 성질을 가지고 있다. </p>



<p class="wp-block-paragraph">가장 대표적인 성질은 <strong>직진하는 성질</strong>이다.</p>



<p class="wp-block-paragraph">매질이 없는 진공 또는 투명한 매질을 통과할 경우 직진한다.</p>



<p class="wp-block-paragraph">빛이 다른 무언가와 부딪치면 </p>



<ul class="wp-block-list">
<li>반사(Reflection) : 빛이 표면과 부딪혔을 때, 표면에서 특정 각도로 반사되는 현상</li>



<li>굴절(Refraction) : 빛이 한 매질에서 다른 매질로 옮겨갈 때, 빛의 속도가 달라지면서 방향이 바뀌는 현상</li>



<li>투과(Transmission) : 빛이 투명한 매체를 통과하며 진행하는 현상으로, 투과된 빛은 매체를 통과한 후 계속 이동</li>



<li>산란(Scattering) : 빛이 표면이나 매질의 불순물과 상호 작용하여 여러 방향으로 흩어지는 현상</li>



<li>흡수(Absorption) : 빛이 물질에 흡수되어 일부 또는 전체적으로 에너지로 전환되는 현상</li>



<li>간섭(Interference): 두 개 이상의 빛 파동이 만나서 서로 상호 작용할 때 나타나는 현상으로, 파동의 합이 강화되거나 약화되는 현상</li>



<li>회절(Refraction): 빛이 물체의 경계면을 통과할 때 파동의 속도가 변함에 따라 방향이 바뀌는 현상</li>
</ul>



<div class="wp-block-uagb-container uagb-block-7215f155 default uagb-is-root-container">
<div class="wp-block-uagb-container uagb-block-ae5ae1b4">
<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-7387b849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="816" height="452" src="https://lycos7560.com/wp-content/uploads/2024/03/image-3.png" alt="" class="wp-image-37952" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-3.png 816w, https://lycos7560.com/wp-content/uploads/2024/03/image-3-300x166.png 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-3-768x425.png 768w" sizes="(max-width: 816px) 100vw, 816px" /><figcaption class="wp-element-caption"><a href="https://www.chemi-in.com/605" target="_blank" rel="noreferrer noopener">https://www.chemi-in.com/605</a></figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image aligncenter size-full is-resized"><img decoding="async" width="551" height="349" src="https://lycos7560.com/wp-content/uploads/2024/03/image-4.png" alt="" class="wp-image-37956" style="width:615px;height:auto" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-4.png 551w, https://lycos7560.com/wp-content/uploads/2024/03/image-4-300x190.png 300w" sizes="(max-width: 551px) 100vw, 551px" /><figcaption class="wp-element-caption"><a href="https://blog.signifykorea.com/?p=10761" target="_blank" rel="noreferrer noopener">https://blog.signifykorea.com/?p=10761</a></figcaption></figure>
</div>
</div>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-7387b849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="border-width:1px;padding-top:var(--wp--preset--spacing--60);padding-right:var(--wp--preset--spacing--60);padding-bottom:var(--wp--preset--spacing--60);padding-left:var(--wp--preset--spacing--60)">
<p class="has-medium-font-size wp-block-paragraph"><strong>정반사(Specular Reflection)</strong> / <strong>난반사(Diffuse Reflection)</strong> &#8211; <strong>반사(Reflection)</strong></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image alignleft size-full"><img decoding="async" width="756" height="296" src="https://lycos7560.com/wp-content/uploads/2024/03/image-5.png" alt="" class="wp-image-37957" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-5.png 756w, https://lycos7560.com/wp-content/uploads/2024/03/image-5-300x117.png 300w" sizes="(max-width: 756px) 100vw, 756px" /><figcaption class="wp-element-caption"><a href="https://commons.wikimedia.org/wiki/File:Specular_v_Diffuse_reflection.png" target="_blank" rel="noreferrer noopener">https://commons.wikimedia.org/wiki/File:Specular_v_Diffuse_reflection.png</a></figcaption></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<ul class="wp-block-list">
<li><strong>정반사(Regular Reflection)</strong><br>정반사는 표면이 매우 매끄럽고 평평한 경우 발생<br>이 때, 빛은 표면과 수직인 방향으로 반사됩니다. <br>거울이나 유리와 같이 매우 매끄러운 표면에서 주로 나타납니다.</li>
</ul>



<ul class="wp-block-list">
<li><strong>난반사(Diffuse Reflection)</strong><br>난반사는 표면이 거친 경우나 불규칙한 표면에서 발생합니다. <br>이 때, 반사된 빛은 여러 방향으로 흩어집니다. <br>벽, 종이, 나무 등의 표면에서 주로 나타납니다.</li>
</ul>
</div>
</div>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-7387b849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="border-width:1px;padding-top:var(--wp--preset--spacing--60);padding-right:var(--wp--preset--spacing--60);padding-bottom:var(--wp--preset--spacing--60);padding-left:var(--wp--preset--spacing--60)">
<p class="has-medium-font-size wp-block-paragraph"><strong>굴절(Refraction)과 투과(Transmission)</strong></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph"><strong>굴절(Refraction)</strong></p>



<p class="wp-block-paragraph">물체를 통과하는 빛은 일반적으로 직선으로 이동하는 것이 아니라, 물체의 경계면을 통과할 때 굴절(Refraction) 현상이 일어납니다.</p>



<p class="wp-block-paragraph">위와 같은 현상은 빛이 한 매질에서 다른 매질로 옮겨갈 때 빛의 속도가 달라지면서 발생합니다.</p>



<p class="wp-block-paragraph">빛의 속도가 다른 매질로 옮겨갈 때, 빛은 특정 각도로 바뀌어 이동합니다. </p>



<p class="wp-block-paragraph">이때 빛의 파장은 그대로 유지되지만, 진행 방향이 바뀌게 됩니다.</p>



<p class="wp-block-paragraph">예를 들어, 빛이 물체에서 공기로 옮겨갈 때는 <strong>경계면을 통과할 때 빛의 속도가 증가하게 되어 굴절각이 작아지게 됩니다.</strong> </p>



<p class="wp-block-paragraph">반대로, 빛이 공기에서 유리 등의 <strong>밀도가 높은 매질로 옮겨갈 때는 굴절각이 커지게 됩니다.</strong></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-7387b849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="1574" height="1154" src="https://lycos7560.com/wp-content/uploads/2024/03/image-6.jpg" alt="" class="wp-image-37961" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-6.jpg 1574w, https://lycos7560.com/wp-content/uploads/2024/03/image-6-300x220.jpg 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-6-768x563.jpg 768w, https://lycos7560.com/wp-content/uploads/2024/03/image-6-1536x1126.jpg 1536w" sizes="(max-width: 1574px) 100vw, 1574px" /><figcaption class="wp-element-caption"><a href="https://www.britannica.com/science/refraction" target="_blank" rel="noreferrer noopener">https://www.britannica.com/science/refraction</a></figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="1119" height="740" src="https://lycos7560.com/wp-content/uploads/2024/03/image-6-1.jpg" alt="" class="wp-image-37962" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-6-1.jpg 1119w, https://lycos7560.com/wp-content/uploads/2024/03/image-6-1-300x198.jpg 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-6-1-768x508.jpg 768w" sizes="(max-width: 1119px) 100vw, 1119px" /><figcaption class="wp-element-caption"><a href="https://en.wikipedia.org/wiki/Refraction" target="_blank" rel="noreferrer noopener">https://en.wikipedia.org/wiki/Refraction</a></figcaption></figure>
</div>
</div>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="wp-block-paragraph">빛은 파동과 입자의 성질을 동시에 가지고 있는데 굴절은 파동의 특성에 의해서 발생합니다.</p>



<p class="wp-block-paragraph"><a href="https://www.microscopyu.com/tutorials/refraction" target="_blank" rel="noreferrer noopener">https://www.microscopyu.com/tutorials/refraction</a></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="520" height="394" src="https://lycos7560.com/wp-content/uploads/2024/03/image-6.png" alt="" class="wp-image-37970" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-6.png 520w, https://lycos7560.com/wp-content/uploads/2024/03/image-6-300x227.png 300w" sizes="(max-width: 520px) 100vw, 520px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph"><strong>투과(Transmission)</strong></p>



<p class="wp-block-paragraph">빛이 투명한 매체를 통과하여 이동하는 현상을 의미합니다. </p>



<p class="wp-block-paragraph">즉, 빛이 매질을 통과한 후 계속 진행되는 것을 말합니다. </p>



<p class="wp-block-paragraph">투과된 빛은 매체를 통과한 후에도 에너지를 가지고 있어 이동을 계속합니다. </p>



<p class="wp-block-paragraph">예를 들어, 유리, 공기, 물 등의 투명한 매체를 통과하는 빛은 투과된 빛입니다. </p>



<p class="wp-block-paragraph">이는 투과된 빛이 매질의 내부에서 계속 이동하고 있음을 나타냅니다.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="825" height="490" src="https://lycos7560.com/wp-content/uploads/2024/03/image-6-2.jpg" alt="" class="wp-image-37964" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-6-2.jpg 825w, https://lycos7560.com/wp-content/uploads/2024/03/image-6-2-300x178.jpg 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-6-2-768x456.jpg 768w" sizes="(max-width: 825px) 100vw, 825px" /><figcaption class="wp-element-caption"><a href="https://gamma-sci.com/2021/08/16/light-transmission-in-the-ocean-and-other-bodies-of-water/" target="_blank" rel="noreferrer noopener">https://gamma-sci.com/2021/08/16/light-transmission-in-the-ocean-and-other-bodies-of-water/</a></figcaption></figure>
</div>
</div>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-7387b849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="border-width:1px;padding-top:var(--wp--preset--spacing--60);padding-right:var(--wp--preset--spacing--60);padding-bottom:var(--wp--preset--spacing--60);padding-left:var(--wp--preset--spacing--60)">
<p class="has-medium-font-size wp-block-paragraph"><strong>산란(Scattering)과 흡수(Absorption)</strong></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph"><strong>산란(Scattering)</strong></p>



<p class="wp-block-paragraph">산란(Scattering)은 빛이 표면이나 매질의 불순물과 상호 작용하여 여러 방향으로 흩어지는 현상을 의미합니다.</p>



<p class="wp-block-paragraph">이는 불순물의 크기가 빛의 파장과 비슷한 크기일 때 특히 뚜렷하게 나타납니다. </p>



<p class="wp-block-paragraph">산란은 물체를 통과할 때 발생할 수 있으며, 특정 방향으로 진행하는 빛이 여러 방향으로 흩어지기 때문에 빛의 진행 경로가 무작위로 바뀝니다. </p>



<p class="wp-block-paragraph">대기 중의 먼지나 연기와 같은 입자들에 의해 발생하는 태양빛의 산란은 하늘의 푸른 색상을 만들어내는데 중요한 역할을 합니다.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="710" height="1020" src="https://lycos7560.com/wp-content/uploads/2024/03/image-6-3.jpg" alt="" class="wp-image-37965" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-6-3.jpg 710w, https://lycos7560.com/wp-content/uploads/2024/03/image-6-3-209x300.jpg 209w" sizes="(max-width: 710px) 100vw, 710px" /><figcaption class="wp-element-caption"><a href="https://www.color-meanings.com/why-is-the-sky-blue/" target="_blank" rel="noreferrer noopener">https://www.color-meanings.com/why-is-the-sky-blue/</a></figcaption></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="wp-block-paragraph">따뜻한 색은 파장이 길어서 적게 산란되어 지표면에 쉽게 도달하는 반면, 대기의 공기 분자는 파장이 짧은 빛(높은 주파수)인 푸른색을 더 많이 산란시킵니다. </p>



<p class="wp-block-paragraph">이러한 이유로 정오의 하늘이 파란색으로 보입니다.</p>



<p class="wp-block-paragraph">노을이나 일몰 시에는 태양이 지평선 아래로 가려지면서 더 긴 파장의 빛이 더 쉽게 통과합니다. </p>



<p class="wp-block-paragraph">태양 광선이 지평선을 통과하는 동안 지표면을 통과하는 거리가 늘어나면서, 대기를 통과하는 빛은 더 많은 산란을 겪게 됩니다. </p>



<p class="wp-block-paragraph">이에 따라 주로 긴 파장의 색상인 주황색과 붉은색이 우세해져서 노을이 붉게 보입니다.</p>



<p class="wp-block-paragraph">공기 중의 미세먼지, 구름, 연기, 물 속의 부유물과 같은 입자들의 산란은 빛의 파장과 무관하게 주로 흰색으로 산란됩니다. </p>



<p class="wp-block-paragraph">이는 입자들의 크기가 빛의 파장보다 훨씬 크기 때문에 발생하며, 결과적으로 모든 색상의 빛이 균일하게 흩어지게 됩니다. </p>



<p class="wp-block-paragraph">이러한 현상은 주로 하얀색 빛을 만들어냅니다.</p>



<figure class="wp-block-image size-medium is-resized"><img decoding="async" width="300" height="199" src="https://lycos7560.com/wp-content/uploads/2024/03/image-6-4-300x199.jpg" alt="" class="wp-image-37966" style="width:403px;height:auto" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-6-4-300x199.jpg 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-6-4-768x508.jpg 768w, https://lycos7560.com/wp-content/uploads/2024/03/image-6-4.jpg 1313w" sizes="(max-width: 300px) 100vw, 300px" /><figcaption class="wp-element-caption"><strong>레일리 산란</strong>(Rayleigh scattering) <br><a href="https://ko.wikipedia.org/wiki/%EB%A0%88%EC%9D%BC%EB%A6%AC_%EC%82%B0%EB%9E%80" target="_blank" rel="noreferrer noopener">https://ko.wikipedia.org/wiki/%EB%A0%88%EC%9D%BC%EB%A6%AC_%EC%82%B0%EB%9E%80</a></figcaption></figure>



<figure class="wp-block-image size-medium is-resized"><img decoding="async" width="300" height="147" src="https://lycos7560.com/wp-content/uploads/2024/03/image-6-5-300x147.jpg" alt="" class="wp-image-37968" style="width:404px;height:auto" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-6-5-300x147.jpg 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-6-5-768x378.jpg 768w, https://lycos7560.com/wp-content/uploads/2024/03/image-6-5.jpg 830w" sizes="(max-width: 300px) 100vw, 300px" /><figcaption class="wp-element-caption"><strong>미세먼지 산란</strong><br><a href="https://news.sbs.co.kr/news/endPage.do?news_id=N1005245972" target="_blank" rel="noreferrer noopener">https://news.sbs.co.kr/news/endPage.do?news_id=N1005245972</a></figcaption></figure>
</div>
</div>
</div>
</div>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block"
     data-ad-format="autorelaxed"
     data-ad-client="ca-pub-5698326622209671"
     data-ad-slot="4386247858"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://lycos7560.com/etc/%eb%b9%9b%ec%9d%98-%ec%84%b1%ec%a7%88-%ec%9a%94%ec%95%bd/37972/">빛의 성질 &#8211; 요약</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/etc/%eb%b9%9b%ec%9d%98-%ec%84%b1%ec%a7%88-%ec%9a%94%ec%95%bd/37972/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>11 &#8211; 03 ~ 04 Half-Lambert(하프 램버트) 연산 및 완성 (Unity Shader)</title>
		<link>https://lycos7560.com/unity/unity_shader/unity_shader-half-lambert/2873/</link>
					<comments>https://lycos7560.com/unity/unity_shader/unity_shader-half-lambert/2873/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Thu, 01 Dec 2022 05:04:08 +0000</pubDate>
				<category><![CDATA[Unity]]></category>
		<category><![CDATA[UnityShader]]></category>
		<category><![CDATA[atten]]></category>
		<category><![CDATA[Half-Lambert]]></category>
		<category><![CDATA[Lambert]]></category>
		<category><![CDATA[light]]></category>
		<category><![CDATA[lighting]]></category>
		<category><![CDATA[Shader]]></category>
		<category><![CDATA[Standard Surface Shader]]></category>
		<category><![CDATA[Unity Shader]]></category>
		<category><![CDATA[공식]]></category>
		<category><![CDATA[램버트]]></category>
		<category><![CDATA[쉐이더]]></category>
		<category><![CDATA[연산]]></category>
		<category><![CDATA[영상]]></category>
		<category><![CDATA[유니티]]></category>
		<category><![CDATA[하프]]></category>
		<category><![CDATA[하프 램버트]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=2873</guid>

					<description><![CDATA[<p>Unity Shader에서 Half-Lambert(하프 램버트) 연산이 적용되는 방식을 간략하게 예제로 설명합니다.</p>
<p>The post <a href="https://lycos7560.com/unity/unity_shader/unity_shader-half-lambert/2873/">11 &#8211; 03 ~ 04 Half-Lambert(하프 램버트) 연산 및 완성 (Unity Shader)</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<div style="height:51px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">11 &#8211; 03 ~ 04 Half-Lambert(하프 램버트) 연산 및 완성 (Unity Shader)</h2>



<div style="height:28px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">Lambert 라이트는 꽤 가벼운 조명 공식이지만, cos 그래프 연산의 특성상 밝다가&nbsp;너무 갑자기 검게 음영이 떨어지는 단점이 있습니다.&nbsp;</p>



<p class="has-medium-font-size wp-block-paragraph">그래서 이 단점을 해결하고자 만든 것이 Half-Lambert (하프 램버트) 공식입니다.</p>



<p class="has-medium-font-size wp-block-paragraph">물리적으로는 옳지 않지만, 매우 가벼우며 보기 좋은 장점이 있습니다.</p>



<div style="height:24px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="870" height="407" src="https://lycos7560.com/wp-content/uploads/image-417.png" alt="" class="wp-image-2874" srcset="https://lycos7560.com/wp-content/uploads/image-417.png 870w, https://lycos7560.com/wp-content/uploads/image-417-300x140.png 300w, https://lycos7560.com/wp-content/uploads/image-417-768x359.png 768w" sizes="(max-width: 870px) 100vw, 870px" /></figure>



<div style="height:24px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">저번에 글에서 사용한 코드에서 시작하겠습니다.&nbsp;</p>



<div style="height:22px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="csharp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "Custom/CustomLight"
{
    Properties
    {
        _MainTex ("Albedo (RGB)", 2D) = "white" {}
        _BumpMap("Normal Map", 2D) = "white" {}
    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 200

        CGPROGRAM
        #pragma surface surf _MyLight noambient  
        #pragma target 3.0

        sampler2D _MainTex;
        sampler2D _BumpMap;

        struct Input
        {
            float2 uv_MainTex;
            float2 uv_BumpMap;
        };

        void surf (Input IN, inout SurfaceOutput o)
        {

            fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
            float3 d = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
            o.Normal = d;
            o.Albedo = c.rgb;
            o.Alpha = c.a;
        }

        
        float4 Lighting_MyLight(SurfaceOutput s, float3 lightDir, float atten)
        {
            float ndotl = saturate(dot(s.Normal, lightDir));
            return ndotl;
        }

        ENDCG
    }
    FallBack "Diffuse"
}</pre>



<div style="height:51px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">직접 확인해보기 위해서 아래 에셋을 사용했습니다. (무료)</p>



<p class="has-medium-font-size wp-block-paragraph"><a href="https://assetstore.unity.com/packages/3d/characters/humanoids/barbarian-warrior-75519" target="_blank" rel="noreferrer noopener">https://assetstore.unity.com/packages/3d/characters/humanoids/barbarian-warrior-75519</a>&nbsp;&lt;- TestAsset</p>



<div style="height:36px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><a href="https://assetstore.unity.com/packages/3d/characters/humanoids/barbarian-warrior-75519" target="_blank" rel="noreferrer noopener"><img decoding="async" width="1304" height="317" src="https://lycos7560.com/wp-content/uploads/image-388.png" alt="" class="wp-image-2824" srcset="https://lycos7560.com/wp-content/uploads/image-388.png 1304w, https://lycos7560.com/wp-content/uploads/image-388-300x73.png 300w, https://lycos7560.com/wp-content/uploads/image-388-768x187.png 768w" sizes="(max-width: 1304px) 100vw, 1304px" /></a></figure>



<div style="height:33px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="1520" height="508" src="https://lycos7560.com/wp-content/uploads/image-418.png" alt="" class="wp-image-2875" srcset="https://lycos7560.com/wp-content/uploads/image-418.png 1520w, https://lycos7560.com/wp-content/uploads/image-418-300x100.png 300w, https://lycos7560.com/wp-content/uploads/image-418-768x257.png 768w" sizes="(max-width: 1520px) 100vw, 1520px" /></figure>



<div style="height:29px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">위의 이미지는 saturate() 함수로 인하여 0 이하의 값은 전부 0 이 되었습니다.</p>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="885" height="860" src="https://lycos7560.com/wp-content/uploads/image-419.png" alt="" class="wp-image-2876" srcset="https://lycos7560.com/wp-content/uploads/image-419.png 885w, https://lycos7560.com/wp-content/uploads/image-419-300x292.png 300w, https://lycos7560.com/wp-content/uploads/image-419-768x746.png 768w" sizes="(max-width: 885px) 100vw, 885px" /></figure>



<div style="height:28px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">saturate() 를 다시 제거해서 다시 -1 ~ 1까지의 범위를 출력하도록 만들어 줍니다.</p>



<div style="height:22px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="1181" height="234" src="https://lycos7560.com/wp-content/uploads/image-420.png" alt="" class="wp-image-2877" srcset="https://lycos7560.com/wp-content/uploads/image-420.png 1181w, https://lycos7560.com/wp-content/uploads/image-420-300x59.png 300w, https://lycos7560.com/wp-content/uploads/image-420-768x152.png 768w" sizes="(max-width: 1181px) 100vw, 1181px" /></figure>



<div style="height:37px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="1097" height="578" src="https://lycos7560.com/wp-content/uploads/image-421.png" alt="" class="wp-image-2878" srcset="https://lycos7560.com/wp-content/uploads/image-421.png 1097w, https://lycos7560.com/wp-content/uploads/image-421-300x158.png 300w, https://lycos7560.com/wp-content/uploads/image-421-768x405.png 768w" sizes="(max-width: 1097px) 100vw, 1097px" /></figure>



<div style="height:41px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">변경 전</p>



<div style="height:45px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-video"><video height="840" style="aspect-ratio: 1272 / 840;" width="1272" controls src="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_13_40_14_926.mp4"></video></figure>



<div style="height:62px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">그리고 라이팅의 결과물에&nbsp; Half- Lamber ( 하프 람버트 ) 공식인&nbsp;&nbsp;<strong>* 0.5 + 0.5</strong>&nbsp; 를 적용해줍니다.</p>



<div style="height:52px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="948" height="167" src="https://lycos7560.com/wp-content/uploads/image-422.png" alt="" class="wp-image-2880" srcset="https://lycos7560.com/wp-content/uploads/image-422.png 948w, https://lycos7560.com/wp-content/uploads/image-422-300x53.png 300w, https://lycos7560.com/wp-content/uploads/image-422-768x135.png 768w" sizes="(max-width: 948px) 100vw, 948px" /></figure>



<div style="height:76px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">Half- Lamber ( 하프 람버트 공식) 적용 후</h2>



<div style="height:35px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-video"><video height="832" style="aspect-ratio: 1304 / 832;" width="1304" controls src="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_13_43_51_403.mp4"></video></figure>



<div style="height:55px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph"><strong>* 0.5 + 0.5</strong>&nbsp; 의 식은 -1 에서부터 1까지의 숫자를 0 에서 부터 1까지의 범위로 만들어 줍니다.</p>



<p class="has-medium-font-size wp-block-paragraph">아래의 푸른 cos 이 붉은 라인으로 끌어 올라오게 됩니다.</p>



<p class="has-medium-font-size wp-block-paragraph">이로 인하여 매우 부드러운 결과 값이 나오게 됩니다.</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="802" height="732" src="https://lycos7560.com/wp-content/uploads/image-423.png" alt="" class="wp-image-2882" srcset="https://lycos7560.com/wp-content/uploads/image-423.png 802w, https://lycos7560.com/wp-content/uploads/image-423-300x274.png 300w, https://lycos7560.com/wp-content/uploads/image-423-768x701.png 768w" sizes="(max-width: 802px) 100vw, 802px" /></figure>



<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">실제 사용할 때에는 빛의 영향을 좀 줄이고자 제곱을 해서 사용합니다.&nbsp;&nbsp;</p>



<div style="height:39px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="1078" height="196" src="https://lycos7560.com/wp-content/uploads/image-424.png" alt="" class="wp-image-2883" srcset="https://lycos7560.com/wp-content/uploads/image-424.png 1078w, https://lycos7560.com/wp-content/uploads/image-424-300x55.png 300w, https://lycos7560.com/wp-content/uploads/image-424-768x140.png 768w" sizes="(max-width: 1078px) 100vw, 1078px" /></figure>



<div style="height:21px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="csharp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "Custom/CustomLight"
{
    Properties
    {
        _MainTex ("Albedo (RGB)", 2D) = "white" {}
        _BumpMap("Normal Map", 2D) = "white" {}
    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 200

        CGPROGRAM
        #pragma surface surf _MyLight noambient  
        #pragma target 3.0

        sampler2D _MainTex;
        sampler2D _BumpMap;

        struct Input
        {
            float2 uv_MainTex;
            float2 uv_BumpMap;
        };

        void surf (Input IN, inout SurfaceOutput o)
        {

            fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
            float3 d = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
            o.Normal = d;
            o.Albedo = c.rgb;
            o.Alpha = c.a;
        }

        
        float4 Lighting_MyLight(SurfaceOutput s, float3 lightDir, float atten)
        {
            float ndotl = dot(s.Normal, lightDir) * 0.5 + 0.5;
            return pow(ndotl, 3); // pow는 제곱
        }

        ENDCG
    }
    FallBack "Diffuse"
}</pre>



<div style="height:60px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">pow&nbsp; &nbsp;제곱 적용 후</p>



<div style="height:29px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-video"><video height="828" style="aspect-ratio: 1304 / 828;" width="1304" controls src="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_13_45_59_585.mp4"></video></figure>



<div style="height:129px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">Lambert 라이트 완성하기</h2>



<div style="height:31px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">위의 상황은 빛 방향에 따른 밝기만 구현되었을 뿐, 조명의 색상과 강고 / 빛 감쇄 Albedo 텍스쳐 는 전혀 적용되지 않았습니다.</p>



<p class="has-medium-font-size wp-block-paragraph">아래에서 나머지 내용을 추가하겠습니다.&nbsp;</p>



<p class="has-medium-font-size wp-block-paragraph">pow와 dot 계산식을 하나로 병합합니다.</p>



<div style="height:29px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="968" height="171" src="https://lycos7560.com/wp-content/uploads/image-425.png" alt="" class="wp-image-2885" srcset="https://lycos7560.com/wp-content/uploads/image-425.png 968w, https://lycos7560.com/wp-content/uploads/image-425-300x53.png 300w, https://lycos7560.com/wp-content/uploads/image-425-768x136.png 768w" sizes="(max-width: 968px) 100vw, 968px" /></figure>



<div style="height:54px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">제 텍스쳐와 조명색상, 감쇠를 연산해서 조명을 완성해줍니다.</p>



<div style="height:28px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="1023" height="258" src="https://lycos7560.com/wp-content/uploads/image-426.png" alt="" class="wp-image-2886" srcset="https://lycos7560.com/wp-content/uploads/image-426.png 1023w, https://lycos7560.com/wp-content/uploads/image-426-300x76.png 300w, https://lycos7560.com/wp-content/uploads/image-426-768x194.png 768w" sizes="(max-width: 1023px) 100vw, 1023px" /></figure>



<div style="height:78px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">전체 코드</p>



<div style="height:24px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="csharp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "Custom/CustomLight"
{
    Properties
    {
        _MainTex ("Albedo (RGB)", 2D) = "white" {}
        _BumpMap("Normal Map", 2D) = "white" {}
    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 200

        CGPROGRAM
        #pragma surface surf _MyLight noambient  
        #pragma target 3.0

        sampler2D _MainTex;
        sampler2D _BumpMap;

        struct Input
        {
            float2 uv_MainTex;
            float2 uv_BumpMap;
        };

        void surf (Input IN, inout SurfaceOutput o)
        {

            fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
            float3 d = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
            o.Normal = d;
            o.Albedo = c.rgb;
            o.Alpha = c.a;
        }

        
        float4 Lighting_MyLight(SurfaceOutput s, float3 lightDir, float atten)
        {
            float ndotl = pow ( dot(s.Normal, lightDir) * 0.5 + 0.5 , 3 );
            float4 final;
            final.rgb = ndotl * s.Albedo * _LightColor0.rgb * atten;
            final.a = s.Alpha;
            return final; 
        }

        ENDCG
    }
    FallBack "Diffuse"
}</pre>



<div style="height:46px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="540" height="441" src="https://lycos7560.com/wp-content/uploads/image-427.png" alt="" class="wp-image-2887" srcset="https://lycos7560.com/wp-content/uploads/image-427.png 540w, https://lycos7560.com/wp-content/uploads/image-427-300x245.png 300w" sizes="(max-width: 540px) 100vw, 540px" /></figure>



<div style="height:36px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">비어있던 MainTex도 넣어줍니다.</p>



<div style="height:44px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-video"><video height="828" style="aspect-ratio: 1336 / 828;" width="1336" controls src="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_13_49_10_310.mp4"></video></figure>



<div style="height:41px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="935" height="134" src="https://lycos7560.com/wp-content/uploads/image-428.png" alt="" class="wp-image-2889" srcset="https://lycos7560.com/wp-content/uploads/image-428.png 935w, https://lycos7560.com/wp-content/uploads/image-428-300x43.png 300w, https://lycos7560.com/wp-content/uploads/image-428-768x110.png 768w" sizes="(max-width: 935px) 100vw, 935px" /></figure>



<div style="height:164px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>s.Albedo&nbsp;</strong></h2>



<p class="has-medium-font-size wp-block-paragraph">Albedo 로 입력받은 텍스쳐 입니다.</p>



<p class="has-medium-font-size wp-block-paragraph">SurfaceOutput이 s 로 들어왔으니 s.Albedo 가 됩니다.</p>



<p class="has-medium-font-size wp-block-paragraph">여기서 들어온 Albedo 텍스쳐가 Lambert 라이트와 연산이 되어서 Diffuse (확산) 됩니다.&nbsp;</p>



<div style="height:35px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>_LightColor0.rgb</strong></h2>



<p class="has-medium-font-size wp-block-paragraph">이전에 연산했던 Ndotl 연산은 조명과 노멀의 각도를 표현한 것 뿐입니다.</p>



<p class="has-medium-font-size wp-block-paragraph">조명의 색상이나 강도는 이 내장 변수를 이용해서 조명의 색상이나 강도를 가져옵니다.</p>



<p class="has-medium-font-size wp-block-paragraph">이 변수를 곱한 후 조명의 생상과 강도를 변화시키면 그대로 반영됩니다.&nbsp;</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>atten</strong></h2>



<p class="has-medium-font-size wp-block-paragraph">빛의 감쇠 현상을 시뮬레이트합니다.</p>



<p class="has-medium-font-size wp-block-paragraph">빛의 감쇠가 일어나는 경우는 아래와 같습니다. (atten를 계산하지 않으면 다음 일이 일어나지 않습니다.)</p>



<div style="height:62px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>1. self shadow가 생기지 않습니다.</strong></h2>



<p class="has-medium-font-size wp-block-paragraph">자신의 그림자를 자신이 받지 않습니다.</p>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="1132" height="446" src="https://lycos7560.com/wp-content/uploads/image-429.png" alt="" class="wp-image-2890" srcset="https://lycos7560.com/wp-content/uploads/image-429.png 1132w, https://lycos7560.com/wp-content/uploads/image-429-300x118.png 300w, https://lycos7560.com/wp-content/uploads/image-429-768x303.png 768w" sizes="(max-width: 1132px) 100vw, 1132px" /></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong><u>2. receive shadow가 동작하지 않습니다.</u></strong></h2>



<p class="has-medium-font-size wp-block-paragraph">다른 물체가 그림자를 드리우지 못합니다.</p>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="1519" height="479" src="https://lycos7560.com/wp-content/uploads/image-430.png" alt="" class="wp-image-2891" srcset="https://lycos7560.com/wp-content/uploads/image-430.png 1519w, https://lycos7560.com/wp-content/uploads/image-430-300x95.png 300w, https://lycos7560.com/wp-content/uploads/image-430-768x242.png 768w" sizes="(max-width: 1519px) 100vw, 1519px" /></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>3. 조명의 감쇠 현상이 일어나지 않습니다.</strong></h2>



<p class="has-medium-font-size wp-block-paragraph">Directional 라이트에서는 확인이 불가능하고&nbsp; point 라이트에서 확인이 가능합니다.</p>



<p class="has-medium-font-size wp-block-paragraph">point 라이트가 멀어질수록 어두워지는데 이것이 atten가 하는 일입니다.&nbsp;</p>



<div style="height:31px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">atten 미적용</p>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-video"><video height="832" style="aspect-ratio: 1280 / 832;" width="1280" controls src="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_13_54_13_816.mp4"></video></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">atten 적용</p>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-video"><video height="832" style="aspect-ratio: 1280 / 832;" width="1280" controls src="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_13_55_17_400.mp4"></video></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">//&nbsp; noambient&nbsp; 제거</p>



<div style="height:33px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="csharp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "Custom/CustomLight"
{
    Properties
    {
        _MainTex ("Albedo (RGB)", 2D) = "white" {}
        _BumpMap("Normal Map", 2D) = "white" {}
    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 200

        CGPROGRAM
        #pragma surface surf _MyLight //noambient  
        #pragma target 3.0

        sampler2D _MainTex;
        sampler2D _BumpMap;

        struct Input
        {
            float2 uv_MainTex;
            float2 uv_BumpMap;
        };

        void surf (Input IN, inout SurfaceOutput o)
        {

            fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
            float3 d = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
            o.Normal = d;
            o.Albedo = c.rgb;
            o.Alpha = c.a;
        }

        
        float4 Lighting_MyLight(SurfaceOutput s, float3 lightDir, float atten)
        {
            float ndotl = pow ( dot(s.Normal, lightDir) * 0.5 + 0.5 , 3 );
            float4 final;
            final.rgb = ndotl * s.Albedo * _LightColor0.rgb * atten;
            final.a = s.Alpha;
            return final; 
        }

        ENDCG
    }
    FallBack "Diffuse"
}</pre>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-video"><video height="832" style="aspect-ratio: 1480 / 832;" width="1480" controls src="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_13_56_59_799.mp4"></video></figure>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--80);margin-bottom:var(--wp--preset--spacing--80)"/>



<figure class="wp-block-image size-full"><img decoding="async" width="1084" height="114" src="https://lycos7560.com/wp-content/uploads/image-431.png" alt="" class="wp-image-2895" srcset="https://lycos7560.com/wp-content/uploads/image-431.png 1084w, https://lycos7560.com/wp-content/uploads/image-431-300x32.png 300w, https://lycos7560.com/wp-content/uploads/image-431-768x81.png 768w" sizes="(max-width: 1084px) 100vw, 1084px" /></figure>



<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">이렇게 적용하면 얼굴이 밝아지면서 atten으로 생기는 얼굴의 그림자가 두드러지게 보이는 단점이 생길 것 입니다.</p>



<p class="has-medium-font-size wp-block-paragraph">정답은 없고 atten를 제거해도 좋고 pow 함수를 이용하여 적절하게 숨기는 것도 하나의 방법입니다.</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">이제 완전한 Lambert 가 완성되었습니다.</p>



<p class="has-medium-font-size wp-block-paragraph">이것은 유니티4까지 사용되었던 Bump Diffuse와 완전히 같은 쉐이더이며</p>



<p class="has-medium-font-size wp-block-paragraph">유니티5에서도 Legacy Shaders / Bumped Diffuse와도 완전히 같은 쉐이더입니다.</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<p>The post <a href="https://lycos7560.com/unity/unity_shader/unity_shader-half-lambert/2873/">11 &#8211; 03 ~ 04 Half-Lambert(하프 램버트) 연산 및 완성 (Unity Shader)</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/unity/unity_shader/unity_shader-half-lambert/2873/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		<enclosure url="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_13_40_14_926.mp4" length="1789228" type="video/mp4" />
<enclosure url="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_13_43_51_403.mp4" length="1396326" type="video/mp4" />
<enclosure url="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_13_45_59_585.mp4" length="1170911" type="video/mp4" />
<enclosure url="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_13_49_10_310.mp4" length="1081007" type="video/mp4" />
<enclosure url="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_13_54_13_816.mp4" length="527708" type="video/mp4" />
<enclosure url="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_13_55_17_400.mp4" length="823267" type="video/mp4" />
<enclosure url="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_13_56_59_799.mp4" length="1167010" type="video/mp4" />

			</item>
		<item>
		<title>11 &#8211; 01 ~ 02 커스텀 라이트 기본형 / Lambert 라이트 연산 (Unity Shader)</title>
		<link>https://lycos7560.com/unity/unity_shader/unity_shader-custom-lights-lambert-lights/2852/</link>
					<comments>https://lycos7560.com/unity/unity_shader/unity_shader-custom-lights-lambert-lights/2852/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Thu, 01 Dec 2022 02:50:54 +0000</pubDate>
				<category><![CDATA[Unity]]></category>
		<category><![CDATA[UnityShader]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[Lambert]]></category>
		<category><![CDATA[light]]></category>
		<category><![CDATA[lighting]]></category>
		<category><![CDATA[Shader]]></category>
		<category><![CDATA[Standard Surface Shader]]></category>
		<category><![CDATA[Unity Shader]]></category>
		<category><![CDATA[기본형]]></category>
		<category><![CDATA[쉐이더]]></category>
		<category><![CDATA[유니티]]></category>
		<category><![CDATA[유니티 쉐이더 스타트업]]></category>
		<category><![CDATA[커스텀라이트]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=2852</guid>

					<description><![CDATA[<p>커스텀 라이트의 기본형과 Lambert 라이트를 구현하는 방법을 예제로 간략하게 설명한 글입니다.</p>
<p>The post <a href="https://lycos7560.com/unity/unity_shader/unity_shader-custom-lights-lambert-lights/2852/">11 &#8211; 01 ~ 02 커스텀 라이트 기본형 / Lambert 라이트 연산 (Unity Shader)</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<div style="height:58px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">11 &#8211; 01 ~ 02 커스텀 라이트 기본형 / Lambert 라이트 연산 (Unity Shader)</h2>



<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">텍스처 한 장만 받는 기본형 쉐이더를 만듭니다.</p>



<div style="height:46px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">직접 확인해보기 위해서 아래 에셋을 사용했습니다. (무료)</p>



<p class="has-medium-font-size wp-block-paragraph"><a href="https://assetstore.unity.com/packages/3d/characters/humanoids/barbarian-warrior-75519" target="_blank" rel="noreferrer noopener">https://assetstore.unity.com/packages/3d/characters/humanoids/barbarian-warrior-75519</a>&nbsp;&lt;- TestAsset</p>



<div style="height:36px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><a href="https://assetstore.unity.com/packages/3d/characters/humanoids/barbarian-warrior-75519" target="_blank" rel="noreferrer noopener"><img decoding="async" width="1304" height="317" src="https://lycos7560.com/wp-content/uploads/image-388.png" alt="" class="wp-image-2824" srcset="https://lycos7560.com/wp-content/uploads/image-388.png 1304w, https://lycos7560.com/wp-content/uploads/image-388-300x73.png 300w, https://lycos7560.com/wp-content/uploads/image-388-768x187.png 768w" sizes="(max-width: 1304px) 100vw, 1304px" /></a></figure>



<div style="height:58px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="csharp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "Custom/CustomLight"
{
    Properties
    {
        _MainTex ("Albedo (RGB)", 2D) = "white" {}
    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 200

        CGPROGRAM
        #pragma surface surf Lambert noambient  
        // noambient - 주변광 또는 라이트 프로브를 적용하지 않습니다.
        #pragma target 3.0
        
        sampler2D _MainTex;

        struct Input
        {
            float2 uv_MainTex;
        };

        void surf (Input IN, inout SurfaceOutput o)
        {

            fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
            o.Albedo = c.rgb;
            o.Alpha = c.a;
        }
        ENDCG
    }
    FallBack "Diffuse"
}</pre>



<div style="height:41px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="1523" height="526" src="https://lycos7560.com/wp-content/uploads/image-404.png" alt="" class="wp-image-2853" srcset="https://lycos7560.com/wp-content/uploads/image-404.png 1523w, https://lycos7560.com/wp-content/uploads/image-404-300x104.png 300w, https://lycos7560.com/wp-content/uploads/image-404-768x265.png 768w" sizes="(max-width: 1523px) 100vw, 1523px" /></figure>



<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">Lambert 라이트를 삭제하고 자신만의 라이트 이름을 지어서 커스텀 라이트를 구동시켜 보겠습니다.</p>



<div style="height:35px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="947" height="939" src="https://lycos7560.com/wp-content/uploads/image-405.png" alt="" class="wp-image-2854" srcset="https://lycos7560.com/wp-content/uploads/image-405.png 947w, https://lycos7560.com/wp-content/uploads/image-405-300x297.png 300w, https://lycos7560.com/wp-content/uploads/image-405-150x150.png 150w, https://lycos7560.com/wp-content/uploads/image-405-768x762.png 768w" sizes="(max-width: 947px) 100vw, 947px" /></figure>



<div style="height:49px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="1530" height="476" src="https://lycos7560.com/wp-content/uploads/image-406.png" alt="" class="wp-image-2855" srcset="https://lycos7560.com/wp-content/uploads/image-406.png 1530w, https://lycos7560.com/wp-content/uploads/image-406-300x93.png 300w, https://lycos7560.com/wp-content/uploads/image-406-768x239.png 768w" sizes="(max-width: 1530px) 100vw, 1530px" /></figure>



<div style="height:68px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">바뀌거나 추가된 내용을 하나씩 보겠습니다.</p>



<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="812" height="120" src="https://lycos7560.com/wp-content/uploads/image-407.png" alt="" class="wp-image-2856" srcset="https://lycos7560.com/wp-content/uploads/image-407.png 812w, https://lycos7560.com/wp-content/uploads/image-407-300x44.png 300w, https://lycos7560.com/wp-content/uploads/image-407-768x113.png 768w" sizes="(max-width: 812px) 100vw, 812px" /></figure>



<div style="height:26px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">Lambert 대신에 _MyLight로 바뀌었습니다.</p>



<p class="has-medium-font-size wp-block-paragraph">여기는 이름을 마음대로 지어도 상관없습니다.</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="904" height="147" src="https://lycos7560.com/wp-content/uploads/image-408.png" alt="" class="wp-image-2857" srcset="https://lycos7560.com/wp-content/uploads/image-408.png 904w, https://lycos7560.com/wp-content/uploads/image-408-300x49.png 300w, https://lycos7560.com/wp-content/uploads/image-408-768x125.png 768w" sizes="(max-width: 904px) 100vw, 904px" /></figure>



<div style="height:23px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">우리가 만든 커스텀 함수의 모습입니다.</p>



<p class="has-medium-font-size wp-block-paragraph">이전까지는 void surf 사용했습니다.</p>



<p class="has-medium-font-size wp-block-paragraph">이 함수는 float4로 시작합니다. 함수가 float4 를 반환 하므로 return float4&nbsp; 출력값을 가지고 있습니다.&nbsp;</p>



<p class="has-medium-font-size wp-block-paragraph">이어서 나오는 이름도 Lighting + &#8220;커스텀 라이트 이름&#8221; 을 추가해 주어야 합니다.</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="542" height="57" src="https://lycos7560.com/wp-content/uploads/image-409.png" alt="" class="wp-image-2858" srcset="https://lycos7560.com/wp-content/uploads/image-409.png 542w, https://lycos7560.com/wp-content/uploads/image-409-300x32.png 300w" sizes="(max-width: 542px) 100vw, 542px" /></figure>



<div style="height:21px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">SurfaceOutput 구조체를 통째로 받아옵니다.</p>



<div style="height:23px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="835" height="365" src="https://lycos7560.com/wp-content/uploads/image-410.png" alt="" class="wp-image-2859" srcset="https://lycos7560.com/wp-content/uploads/image-410.png 835w, https://lycos7560.com/wp-content/uploads/image-410-300x131.png 300w, https://lycos7560.com/wp-content/uploads/image-410-768x336.png 768w" sizes="(max-width: 835px) 100vw, 835px" /></figure>



<div style="height:26px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="693" height="400" src="https://lycos7560.com/wp-content/uploads/image-411.png" alt="" class="wp-image-2860" srcset="https://lycos7560.com/wp-content/uploads/image-411.png 693w, https://lycos7560.com/wp-content/uploads/image-411-300x173.png 300w" sizes="(max-width: 693px) 100vw, 693px" /></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">float3 lightDir 은 이전 파트에서 배웠던 조명 방향의 벡터 입니다.</p>



<p class="has-medium-font-size wp-block-paragraph">단, 조명 계산을 편하게 사용하기 위해서 뒤집혀지고 길이가 1인 단위 벡터의 상태입니다.</p>



<div style="height:27px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="818" height="455" src="https://lycos7560.com/wp-content/uploads/image-412.png" alt="" class="wp-image-2861" srcset="https://lycos7560.com/wp-content/uploads/image-412.png 818w, https://lycos7560.com/wp-content/uploads/image-412-300x167.png 300w, https://lycos7560.com/wp-content/uploads/image-412-768x427.png 768w" sizes="(max-width: 818px) 100vw, 818px" /></figure>



<div style="height:23px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">float atten</p>



<p class="has-medium-font-size wp-block-paragraph">atten ( attenuation ) 감쇠</p>



<p class="has-medium-font-size wp-block-paragraph">그림자를 받거나 거리가 멀어지면서 점점 조명이 흐려지는 라이트의 거리별 감쇠 현상을 나타냅니다.</p>



<p class="has-medium-font-size wp-block-paragraph">내가 빛을 받는 것을 없앨 때 사용하는 부분입니다.</p>



<div style="height:28px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--80);margin-bottom:var(--wp--preset--spacing--80)"/>



<p class="has-medium-font-size wp-block-paragraph">Lambert&nbsp;라이트&nbsp;연산</p>



<p class="has-medium-font-size wp-block-paragraph">우리가 만든 커스텀 라이트에서 변경합니다.</p>



<div style="height:37px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="1058" height="403" src="https://lycos7560.com/wp-content/uploads/image-413.png" alt="" class="wp-image-2862" srcset="https://lycos7560.com/wp-content/uploads/image-413.png 1058w, https://lycos7560.com/wp-content/uploads/image-413-300x114.png 300w, https://lycos7560.com/wp-content/uploads/image-413-768x293.png 768w" sizes="(max-width: 1058px) 100vw, 1058px" /></figure>



<div style="height:33px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="csharp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "Custom/CustomLight"
{
    Properties
    {
        _MainTex ("Albedo (RGB)", 2D) = "white" {}
    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 200

        CGPROGRAM
        #pragma surface surf _MyLight noambient  
        // noambient - 주변광 또는 라이트 프로브를 적용하지 않습니다.
        #pragma target 3.0

        sampler2D _MainTex;

        struct Input
        {
            float2 uv_MainTex;
        };

        void surf (Input IN, inout SurfaceOutput o)
        {

            fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
            o.Albedo = c.rgb;
            o.Alpha = c.a;
        }

        
        float4 Lighting_MyLight(SurfaceOutput s, float3 lightDir, float atten)
        {
            float ndotl = dot(s.Normal, lightDir);
            // dot 노멀 백터와 라이트 벡터를 내적 연산
            // surf 에서 Normal 값을 받지 않아도 버텍스에서 노말값을 평범하게 받음

            return ndotl;
        }

        ENDCG
    }
    FallBack "Diffuse"
}</pre>



<div style="height:43px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-video"><video height="688" style="aspect-ratio: 1464 / 688;" width="1464" controls src="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_11_38_53_802.mp4"></video></figure>



<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">lightDir은 버텍스에서 바라보는 조명의 방향인 뒤집힌 방향 이기 때문에 두 벤터를 단순하게 내적해주면 cos 값이 나오게 됩니다.</p>



<div style="height:36px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="1533" height="530" src="https://lycos7560.com/wp-content/uploads/image-414.png" alt="" class="wp-image-2864" srcset="https://lycos7560.com/wp-content/uploads/image-414.png 1533w, https://lycos7560.com/wp-content/uploads/image-414-300x104.png 300w, https://lycos7560.com/wp-content/uploads/image-414-768x266.png 768w" sizes="(max-width: 1533px) 100vw, 1533px" /></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">위와 같은 코드는 가장 밝은 곳이 1 / 어두워 지는 경계선은 0 / 가장 어두운 곳은 -1 값으로 되어서</p>



<p class="has-medium-font-size wp-block-paragraph">나중에 추가 라이트를 비추거나 할 때 문제가 됩니다.&nbsp;</p>



<p class="has-medium-font-size wp-block-paragraph">이 현상을 방지하기 위해서&nbsp; saturate (값) 함수를 사용합니다.</p>



<p class="has-medium-font-size wp-block-paragraph">max 함수도 사용하지만 최대 값이 없습니다.</p>



<p class="has-medium-font-size wp-block-paragraph">max(0, dot(s.Normal, lightDir));</p>



<p class="has-medium-font-size wp-block-paragraph">float&nbsp;ndotl&nbsp;=&nbsp;max(0,&nbsp;dot(s.Normal,&nbsp;lightDir));</p>



<div style="height:24px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="819" height="225" src="https://lycos7560.com/wp-content/uploads/image-415.png" alt="" class="wp-image-2865" srcset="https://lycos7560.com/wp-content/uploads/image-415.png 819w, https://lycos7560.com/wp-content/uploads/image-415-300x82.png 300w, https://lycos7560.com/wp-content/uploads/image-415-768x211.png 768w" sizes="(max-width: 819px) 100vw, 819px" /></figure>



<div style="height:28px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="csharp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "Custom/CustomLight"
{
    Properties
    {
        _MainTex ("Albedo (RGB)", 2D) = "white" {}
    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 200

        CGPROGRAM
        #pragma surface surf _MyLight noambient  
        // noambient - 주변광 또는 라이트 프로브를 적용하지 않습니다.
        #pragma target 3.0

        sampler2D _MainTex;

        struct Input
        {
            float2 uv_MainTex;
        };

        void surf (Input IN, inout SurfaceOutput o)
        {

            fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
            o.Albedo = c.rgb;
            o.Alpha = c.a;
        }

        
        float4 Lighting_MyLight(SurfaceOutput s, float3 lightDir, float atten)
        {
            float ndotl = saturate(dot(s.Normal, lightDir));

            // dot 노멀 백터와 라이트 벡터를 내적 연산
            // surf 에서 Normal 값을 받지 않아도 버텍스에서 노말값을 평범하게 받음
            // saturate 0 이하 값을 0으로 만들어줌
            
            // float ndotl = max(0, dot(s.Normal, lightDir));
            // max 함수도 있지만 최대 값이 없습니다.

            return ndotl;
        }

        ENDCG
    }
    FallBack "Diffuse"
}</pre>



<div style="height:37px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-video"><video height="688" style="aspect-ratio: 1464 / 688;" width="1464" controls src="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_11_41_55_314.mp4"></video></figure>



<div style="height:101px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">NormalMap 적용</p>



<div style="height:29px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="csharp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "Custom/CustomLight"
{
    Properties
    {
        _MainTex ("Albedo (RGB)", 2D) = "white" {}
        _BumpMap("Normal Map", 2D) = "white" {}
    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 200

        CGPROGRAM
        #pragma surface surf _MyLight noambient  
        // noambient - 주변광 또는 라이트 프로브를 적용하지 않습니다.
        #pragma target 3.0

        sampler2D _MainTex;
        sampler2D _BumpMap;

        struct Input
        {
            float2 uv_MainTex;
            float2 uv_BumpMap;
        };

        void surf (Input IN, inout SurfaceOutput o)
        {

            fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
            float3 d = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
            o.Normal = d;
            o.Albedo = c.rgb;
            o.Alpha = c.a;
        }

        
        float4 Lighting_MyLight(SurfaceOutput s, float3 lightDir, float atten)
        {
            float ndotl = saturate(dot(s.Normal, lightDir));

            // dot 노멀 백터와 라이트 벡터를 내적 연산
            // surf 에서 Normal 값을 받지 않아도 버텍스에서 노말값을 평범하게 받음
            // saturate 0 이하 값을 0으로 만들어줌
            
            // float ndotl = max(0, dot(s.Normal, lightDir));
            // max 함수도 있지만 최대 값이 없습니다.

            return ndotl;
        }

        ENDCG
    }
    FallBack "Diffuse"
}</pre>



<div style="height:21px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-video"><video height="688" style="aspect-ratio: 1464 / 688;" width="1464" controls src="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_11_43_19_983.mp4"></video></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">환경광 제거</p>



<div style="height:52px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="924" height="185" src="https://lycos7560.com/wp-content/uploads/image-416.png" alt="" class="wp-image-2868" srcset="https://lycos7560.com/wp-content/uploads/image-416.png 924w, https://lycos7560.com/wp-content/uploads/image-416-300x60.png 300w, https://lycos7560.com/wp-content/uploads/image-416-768x154.png 768w" sizes="(max-width: 924px) 100vw, 924px" /></figure>



<div style="height:33px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-video"><video height="696" style="aspect-ratio: 1464 / 696;" width="1464" controls src="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_11_44_56_814.mp4"></video></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<p>The post <a href="https://lycos7560.com/unity/unity_shader/unity_shader-custom-lights-lambert-lights/2852/">11 &#8211; 01 ~ 02 커스텀 라이트 기본형 / Lambert 라이트 연산 (Unity Shader)</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/unity/unity_shader/unity_shader-custom-lights-lambert-lights/2852/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		<enclosure url="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_11_38_53_802.mp4" length="1320242" type="video/mp4" />
<enclosure url="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_11_41_55_314.mp4" length="1044809" type="video/mp4" />
<enclosure url="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_11_43_19_983.mp4" length="2358455" type="video/mp4" />
<enclosure url="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_11_44_56_814.mp4" length="1993886" type="video/mp4" />

			</item>
		<item>
		<title>9 &#8211; 02 ~ 03 Lambert (램버트) / Blinn-Phong(블린-퐁) (Unity Shader)</title>
		<link>https://lycos7560.com/unity/unity_shader/unity_shader-lambert-blinn-phong/2841/</link>
					<comments>https://lycos7560.com/unity/unity_shader/unity_shader-lambert-blinn-phong/2841/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Thu, 01 Dec 2022 02:26:12 +0000</pubDate>
				<category><![CDATA[Unity]]></category>
		<category><![CDATA[UnityShader]]></category>
		<category><![CDATA[_SpecColor]]></category>
		<category><![CDATA[Blinn-Phong]]></category>
		<category><![CDATA[Lambert]]></category>
		<category><![CDATA[light]]></category>
		<category><![CDATA[lighting]]></category>
		<category><![CDATA[Shader]]></category>
		<category><![CDATA[Specular]]></category>
		<category><![CDATA[Standard Surface Shader]]></category>
		<category><![CDATA[Unity Shader]]></category>
		<category><![CDATA[라이트]]></category>
		<category><![CDATA[쉐이더]]></category>
		<category><![CDATA[유니티]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=2841</guid>

					<description><![CDATA[<p>Unity의 Lambert 라이트와 blinn-pong 라이트를 간단하게 설명하면서 구현하는 글입니다.</p>
<p>The post <a href="https://lycos7560.com/unity/unity_shader/unity_shader-lambert-blinn-phong/2841/">9 &#8211; 02 ~ 03 Lambert (램버트) / Blinn-Phong(블린-퐁) (Unity Shader)</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<div style="height:47px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">9 &#8211; 02 ~ 03 Lambert (램버트) / Blinn-Phong(블린-퐁) (Unity Shader)</h2>



<div style="height:31px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">유니티4 이전 시절에 존재하던 가벼운 라이팅 방식인 Lambert 라이팅</p>



<p class="has-medium-font-size wp-block-paragraph">램버트 라이팅 초기 구조</p>



<div style="height:28px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="709" height="854" src="https://lycos7560.com/wp-content/uploads/image-399.png" alt="" class="wp-image-2842" srcset="https://lycos7560.com/wp-content/uploads/image-399.png 709w, https://lycos7560.com/wp-content/uploads/image-399-249x300.png 249w" sizes="(max-width: 709px) 100vw, 709px" /></figure>



<div style="height:37px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="csharp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "Custom/Lambert"
{
    Properties
    {
        _MainTex ("Albedo (RGB)", 2D) = "white" {}
    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 200

        CGPROGRAM
        #pragma surface surf Lambert
        #pragma target 3.0

        sampler2D _MainTex;

        struct Input
        {
            float2 uv_MainTex;
        };

        void surf (Input IN, inout SurfaceOutput o)
        {
            fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
            o.Albedo = c.rgb;
            o.Alpha = c.a;
        }
        ENDCG
    }
    FallBack "Diffuse"
}</pre>



<div style="height:39px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">둔탁한 느낌의 이미지가 Lambert 라이트의 특징입니다.</p>



<p class="has-medium-font-size wp-block-paragraph">o.Specular / o.Gloss 는 사용하지 않으므로 값을 넣어도 나타나지 않습니다.</p>



<p class="has-medium-font-size wp-block-paragraph">겉으로는 크게 바뀐 것 같지 않지만 내장된 기본 라이팅 구조 중에서 가장 가벼운 라이트입니다. (저사양 기기에서도 잘 구동됩니다.)</p>



<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="1307" height="874" src="https://lycos7560.com/wp-content/uploads/image-400.png" alt="" class="wp-image-2843" srcset="https://lycos7560.com/wp-content/uploads/image-400.png 1307w, https://lycos7560.com/wp-content/uploads/image-400-300x201.png 300w, https://lycos7560.com/wp-content/uploads/image-400-768x514.png 768w" sizes="(max-width: 1307px) 100vw, 1307px" /></figure>



<div style="height:72px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="1339" height="872" src="https://lycos7560.com/wp-content/uploads/image-401.png" alt="" class="wp-image-2844" srcset="https://lycos7560.com/wp-content/uploads/image-401.png 1339w, https://lycos7560.com/wp-content/uploads/image-401-300x195.png 300w, https://lycos7560.com/wp-content/uploads/image-401-768x500.png 768w" sizes="(max-width: 1339px) 100vw, 1339px" /></figure>



<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-video"><video height="836" style="aspect-ratio: 1440 / 836;" width="1440" controls src="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_11_15_46_258.mp4"></video></figure>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--80);margin-bottom:var(--wp--preset--spacing--80)"/>



<h2 class="wp-block-heading">간단한 Blinn Phong 라이트 구현&nbsp;</h2>



<div style="height:31px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="692" height="799" src="https://lycos7560.com/wp-content/uploads/image-402.png" alt="" class="wp-image-2846" srcset="https://lycos7560.com/wp-content/uploads/image-402.png 692w, https://lycos7560.com/wp-content/uploads/image-402-260x300.png 260w" sizes="(max-width: 692px) 100vw, 692px" /></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="csharp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "Custom/BlinnPhong"
{
    Properties
    {
        _MainTex ("Albedo (RGB)", 2D) = "white" {}
    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 200

        CGPROGRAM
        #pragma surface surf BlinnPhong
        #pragma target 3.0

        sampler2D _MainTex;

        struct Input
        {
            float2 uv_MainTex;
        };


        void surf (Input IN, inout SurfaceOutput o)
        {
            fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
            o.Albedo = c.rgb;
            o.Alpha = c.a;
        }
        ENDCG
    }
    FallBack "Diffuse"
}</pre>



<div style="height:64px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">BlinnPhong 공식이 가동 되었지만 Specular는 보이지 않습니다.</p>



<p class="has-medium-font-size wp-block-paragraph">Specular를 보기위해 추가로 데이터를 입력합니다.</p>



<div style="height:66px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="689" height="939" src="https://lycos7560.com/wp-content/uploads/image-403.png" alt="" class="wp-image-2847" srcset="https://lycos7560.com/wp-content/uploads/image-403.png 689w, https://lycos7560.com/wp-content/uploads/image-403-220x300.png 220w" sizes="(max-width: 689px) 100vw, 689px" /></figure>



<div style="height:49px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="csharp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "Custom/BlinnPhong"
{
    Properties
    {
        _MainTex ("Albedo (RGB)", 2D) = "white" {}
        _SpecColor("SpecColor", color) = (1,1,1,1)
    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 200

        CGPROGRAM
        #pragma surface surf BlinnPhong
        #pragma target 3.0

        sampler2D _MainTex;

        struct Input
        {
            float2 uv_MainTex;
        };


        void surf (Input IN, inout SurfaceOutput o)
        {
            fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
            o.Albedo = c.rgb;
            o.Specular = 0.5;
            o.Gloss = 1;
            o.Alpha = c.a;
        }
        ENDCG
    }
    FallBack "Diffuse"
}</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-video"><video height="828" style="aspect-ratio: 1488 / 828;" width="1488" controls src="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_11_18_55_461.mp4"></video></figure>



<div style="height:51px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">위의 코드에서 어디에서도 _SpecColor 를 받는 부분이 없습니다.</p>



<p class="has-medium-font-size wp-block-paragraph">_SpecColor 는 절대로 코드에서 받으면 안 되고, 단지&nbsp; Properties 에서만 만들어야 한다는 것 입니다.</p>



<p class="has-medium-font-size wp-block-paragraph">그리고 _SpecColor 라는 이름 외에 다른 이름을 써서도 안됩니다.</p>



<p class="has-medium-font-size wp-block-paragraph"><strong>BlinnPong 내부의 코드를 열어보면 _SpecColor 이름이 예약어이며 절대로 코드 내부에서 받으면 안된다는 특이한 예외 사항이 존재합니다.</strong></p>



<p class="has-medium-font-size wp-block-paragraph">o.Gloss 는 0~ 1 사이의 값을 넣어야 하며 Specular 의 강도를 의미합니다.</p>



<p class="has-medium-font-size wp-block-paragraph">0이면 둔탁한 재질 / 1이면 매끄러운 재질을 의미합니다.</p>



<p class="has-medium-font-size wp-block-paragraph">o.Specular는 0~ 1 사이의 값을 넣어야 하며 Specular 의 크기를 의미합니다.</p>



<p class="has-medium-font-size wp-block-paragraph">0이면 크기가 커지고&nbsp; / 1이면 크기가 작아집니다.</p>



<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">확인용 코드</p>



<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="csharp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "Custom/BlinnPhong"
{
    Properties
    {
        _MainTex ("Albedo (RGB)", 2D) = "white" {}
        _SpecColor("SpecColor", color) = (1,1,1,1)
        _SpecAmount("SpecAmount",Range(0,1)) = 0.5
        _GlossAmount("_GlossAmount",Range(0,1)) = 1
    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 200

        CGPROGRAM
        #pragma surface surf BlinnPhong
        #pragma target 3.0

        sampler2D _MainTex;
        float _SpecAmount;
        float _GlossAmount;

        struct Input
        {
            float2 uv_MainTex;
        };


        void surf (Input IN, inout SurfaceOutput o)
        {
            fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
            o.Albedo = c.rgb;
            o.Specular = _SpecAmount;
            o.Gloss = _GlossAmount;
            o.Alpha = c.a;
        }
        ENDCG
    }
    FallBack "Diffuse"
}</pre>



<div style="height:72px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-video"><video height="688" style="aspect-ratio: 1464 / 688;" width="1464" controls src="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_11_21_22_869.mp4"></video></figure>



<div style="height:133px" aria-hidden="true" class="wp-block-spacer"></div>
<p>The post <a href="https://lycos7560.com/unity/unity_shader/unity_shader-lambert-blinn-phong/2841/">9 &#8211; 02 ~ 03 Lambert (램버트) / Blinn-Phong(블린-퐁) (Unity Shader)</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/unity/unity_shader/unity_shader-lambert-blinn-phong/2841/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		<enclosure url="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_11_15_46_258.mp4" length="1365005" type="video/mp4" />
<enclosure url="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_11_18_55_461.mp4" length="2616931" type="video/mp4" />
<enclosure url="https://lycos7560.com/wp-content/uploads/녹화_2022_12_01_11_21_22_869.mp4" length="900683" type="video/mp4" />

			</item>
	</channel>
</rss>
