{"id":99,"date":"2014-12-18T22:46:05","date_gmt":"2014-12-18T20:46:05","guid":{"rendered":"http:\/\/heikkili.kapsi.fi\/blog\/?p=99"},"modified":"2024-09-15T14:15:26","modified_gmt":"2024-09-15T12:15:26","slug":"cg-study-4","status":"publish","type":"post","link":"http:\/\/heikkili.kapsi.fi\/blog\/?p=99","title":{"rendered":"CG study #4"},"content":{"rendered":"<p>I finished the chapter 7 of the book 3D Game Programming with DirectX 11 that discussed about lighting model and different light types: directional light, point light and spot light.<\/p>\n<p>ex. 1. asked to modify light colors of the chapters lighting demo.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex1.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"100\" data-permalink=\"http:\/\/heikkili.kapsi.fi\/blog\/?attachment_id=100\" data-orig-file=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex1.png?fit=816%2C639\" data-orig-size=\"816,639\" data-comments-opened=\"1\" data-image-title=\"Capturech7ex1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex1.png?fit=650%2C509\" class=\"alignleft wp-image-100 size-medium\" src=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex1.png?resize=300%2C234\" alt=\"Capturech7ex1\" width=\"300\" height=\"234\" srcset=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex1.png?resize=300%2C234 300w, https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex1.png?resize=383%2C300 383w, https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex1.png?w=816 816w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>ex.2. asked to modify the specular power (p) of the materials in the lighting demo trying different values for it.<\/p>\n<p>land and waves material with p = 256 and p = 64 and p = 8<\/p>\n<figure id=\"attachment_104\" aria-describedby=\"caption-attachment-104\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p256.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"104\" data-permalink=\"http:\/\/heikkili.kapsi.fi\/blog\/?attachment_id=104\" data-orig-file=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p256.png?fit=816%2C639\" data-orig-size=\"816,639\" data-comments-opened=\"1\" data-image-title=\"Capturech7ex2_p256\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p256.png?fit=650%2C509\" class=\"wp-image-104 size-medium\" src=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p256.png?resize=300%2C234\" alt=\"Capturech7ex2_p256\" width=\"300\" height=\"234\" srcset=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p256.png?resize=300%2C234 300w, https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p256.png?resize=383%2C300 383w, https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p256.png?w=816 816w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-104\" class=\"wp-caption-text\">p = 256<\/figcaption><\/figure>\n<figure id=\"attachment_103\" aria-describedby=\"caption-attachment-103\" style=\"width: 300px\" class=\"wp-caption alignleft\"><a href=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p64.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"103\" data-permalink=\"http:\/\/heikkili.kapsi.fi\/blog\/?attachment_id=103\" data-orig-file=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p64.png?fit=816%2C639\" data-orig-size=\"816,639\" data-comments-opened=\"1\" data-image-title=\"Capturech7ex2_p64\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p64.png?fit=650%2C509\" class=\"wp-image-103 size-medium\" src=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p64.png?resize=300%2C234\" alt=\"Capturech7ex2_p64\" width=\"300\" height=\"234\" srcset=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p64.png?resize=300%2C234 300w, https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p64.png?resize=383%2C300 383w, https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p64.png?w=816 816w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-103\" class=\"wp-caption-text\">p = 64<\/figcaption><\/figure>\n<figure id=\"attachment_102\" aria-describedby=\"caption-attachment-102\" style=\"width: 300px\" class=\"wp-caption alignleft\"><a href=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p8.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"102\" data-permalink=\"http:\/\/heikkili.kapsi.fi\/blog\/?attachment_id=102\" data-orig-file=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p8.png?fit=816%2C639\" data-orig-size=\"816,639\" data-comments-opened=\"1\" data-image-title=\"Capturech7ex2_p8\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;p = 8&lt;\/p&gt;\n\" data-large-file=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p8.png?fit=650%2C509\" class=\"wp-image-102 size-medium\" src=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p8.png?resize=300%2C234\" alt=\"p = 8\" width=\"300\" height=\"234\" srcset=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p8.png?resize=300%2C234 300w, https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p8.png?resize=383%2C300 383w, https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex2_p8.png?w=816 816w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-102\" class=\"wp-caption-text\">p = 8<\/figcaption><\/figure>\n<p>ex.3. asked to implement toon shading by modifying diffuse and specular factions.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex3.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"108\" data-permalink=\"http:\/\/heikkili.kapsi.fi\/blog\/?attachment_id=108\" data-orig-file=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex3.png?fit=816%2C639\" data-orig-size=\"816,639\" data-comments-opened=\"1\" data-image-title=\"Capturech7ex3\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex3.png?fit=650%2C509\" class=\"alignleft size-thumbnail wp-image-108\" src=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex3.png?resize=150%2C150\" alt=\"Capturech7ex3\" width=\"150\" height=\"150\" srcset=\"https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex3.png?resize=150%2C150 150w, https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex3.png?zoom=2&amp;resize=150%2C150 300w, https:\/\/i0.wp.com\/heikkili.kapsi.fi\/blog\/wp-content\/uploads\/2014\/12\/Capturech7ex3.png?zoom=3&amp;resize=150%2C150 450w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/><\/a><\/p>\n<p>ex.4 asked to implement\u00a0 keys to to increase and decrease the angle of spotlight cone.<\/p>\n<p>I implemented it by modifying the spot exponent in the spotfactor like this<\/p>\n<pre><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\nif (GetAsyncKeyState(&#039;A&#039;) &amp;amp;amp; 0x8000)\n\t\tmSpotLight.Spot += 10.0f*dt;\n\n\tif (GetAsyncKeyState(&#039;S&#039;) &amp;amp;amp; 0x8000)\n\t\tmSpotLight.Spot -= 10.0f*dt;\n<\/pre>\n<p>next chapter texturing, now we are getting somewhere !<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I finished the chapter 7 of the book 3D Game Programming with DirectX 11 that discussed about lighting model and different light types: directional light, point light and spot light. ex. 1. asked to modify light colors of the chapters lighting demo. ex.2. asked to modify the specular power (p) of the materials in the&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[6],"tags":[4,2],"class_list":["post-99","post","type-post","status-publish","format-standard","hentry","category-computer-graphics","tag-c","tag-directx11"],"jetpack_shortlink":"https:\/\/wp.me\/p7k3DT-1B","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/heikkili.kapsi.fi\/blog\/index.php?rest_route=\/wp\/v2\/posts\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/heikkili.kapsi.fi\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/heikkili.kapsi.fi\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/heikkili.kapsi.fi\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/heikkili.kapsi.fi\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=99"}],"version-history":[{"count":11,"href":"http:\/\/heikkili.kapsi.fi\/blog\/index.php?rest_route=\/wp\/v2\/posts\/99\/revisions"}],"predecessor-version":[{"id":637,"href":"http:\/\/heikkili.kapsi.fi\/blog\/index.php?rest_route=\/wp\/v2\/posts\/99\/revisions\/637"}],"wp:attachment":[{"href":"http:\/\/heikkili.kapsi.fi\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/heikkili.kapsi.fi\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/heikkili.kapsi.fi\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}