diff --git a/_includes/figure-video.html b/_includes/figure-video.html new file mode 100644 index 0000000..c43e16c --- /dev/null +++ b/_includes/figure-video.html @@ -0,0 +1,19 @@ +{% if include.float %} +
+{% else %} +
+{% endif %} + +{% capture path %}/images/{{page.path | split: '/' | last | split: '.' | first }}{% endcapture %} + +{% capture src %}{{ path }}/{{ include.src }}{% endcapture %} +{% capture type %}{{ include.src | split: "." | last }}{% endcapture %} +{% include video.html src=src type=type %} + +{% if include.caption %} +
+ {{ include.caption | markdownify | remove: '

' | remove: '

' }} +
+{% endif %} + +
diff --git a/_includes/head.html b/_includes/head.html index ecd41ee..87bc93d 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -5,7 +5,7 @@ - + diff --git a/_includes/sidebar.html b/_includes/sidebar.html index 856c431..8ee79eb 100644 --- a/_includes/sidebar.html +++ b/_includes/sidebar.html @@ -25,7 +25,7 @@
  • - This Site + This Site
  • diff --git a/_includes/video.html b/_includes/video.html new file mode 100644 index 0000000..197e372 --- /dev/null +++ b/_includes/video.html @@ -0,0 +1,7 @@ + diff --git a/_posts/2019-5-4-Photorealistic-Particles.md b/_posts/2019-5-4-Photorealistic-Particles.md new file mode 100644 index 0000000..d44156d --- /dev/null +++ b/_posts/2019-5-4-Photorealistic-Particles.md @@ -0,0 +1,37 @@ +--- +title: Making Realistic Particle Effects From Photographs +tags: KSP-modding Unity +--- +While working on drills for ReStock I realized I needed some particle effects for when the drills are in use. I wanted the effect of small rocks being kicked up from the ground and falling back down, but my attempts at a texture for the rocks all ended up looking more like potatos. + +{% include figure-image.html + float="right" + src="potato-rock.png" + caption="A lumpy excuse for a rock" %} + +Here on earth, we have plenty of potato-shaped rocks due to erosion in water and wind, but in space theres no such forces to smooth out rocks, and they end up looking far more jagged, and dangerously so. Even small particles of lunar dust is razor sharp when viewed under a microscope. + +Instead of hand-painting a realistic chunk of slag in photoshop I thought I would try creating it using photographs. Rocks are easy to come by, after all, so I grabbed a chunk of what I believe to be granite from outside. Photographing a real sample also has the benefit of allowing for easy flipbook animation of the particles, which KSP’s limitied particle system format luckly supports. + +The setup is pretty simple. I used some mounting putty to hold the rock in 8 different angles, while I photographed it from above with my phone. I used an empty pringles can as a makeshift tripod to hold my phone in the same place for each shot with a fixed focus and exposure, and a stationary desk lamp slightly off-axis. I took 8 pictures total, rotating the rock about 45° each time. + +{% include figure-image.html + src="setup-small.jpg" + caption="The setup, using an empty pringles can as a tripod" %} + +After the photos were taken, I imported them all into photoshop and masked out each one, arranged them into a 2x4 grid for the flipbook animation, and applied some color correction to make them the color I wanted. + +{% include figure-image.html + src="flipbook.png" %} + +I think the result looks pretty good, since the rocks appear to tumble as they are thrown arround, which breaks the illusion of them being flat billboards, which they are. + +{% include figure-video.html + src="effects.mp4" + caption="The effects in action" %} + +Possible future additions to this technique: +- take 3 photos for each rotation with different lighting to make a normal map. +- use more photos for a more smooth animation +- rendering a spinning 3D model in blender instead of using photography + diff --git a/css/style.scss b/css/style.scss index 0ebbbb1..c6e033d 100644 --- a/css/style.scss +++ b/css/style.scss @@ -216,6 +216,18 @@ small { } } +.figure-video { + width: 100%; + margin: 0; + margin-bottom: 20px; + + video { + display: block; + margin-left: auto; + margin-right: auto; + } +} + .figure-float { width: 33%; margin: 10px; diff --git a/images/2017-12-28-G4-Cube-CD/cube-1-small.jpg b/images/2017-12-28-G4-Cube-CD/cube-1-small.jpg index 1500a27..0221d74 100644 Binary files a/images/2017-12-28-G4-Cube-CD/cube-1-small.jpg and b/images/2017-12-28-G4-Cube-CD/cube-1-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/cube-1.jpg b/images/2017-12-28-G4-Cube-CD/cube-1.jpg index 168b90e..9baf9d7 100644 Binary files a/images/2017-12-28-G4-Cube-CD/cube-1.jpg and b/images/2017-12-28-G4-Cube-CD/cube-1.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/cube-2-small.jpg b/images/2017-12-28-G4-Cube-CD/cube-2-small.jpg index 7dea0e9..2eddb95 100644 Binary files a/images/2017-12-28-G4-Cube-CD/cube-2-small.jpg and b/images/2017-12-28-G4-Cube-CD/cube-2-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/cube-2.jpg b/images/2017-12-28-G4-Cube-CD/cube-2.jpg index 2dfa290..3d03686 100644 Binary files a/images/2017-12-28-G4-Cube-CD/cube-2.jpg and b/images/2017-12-28-G4-Cube-CD/cube-2.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/front-cover-1-small.jpg b/images/2017-12-28-G4-Cube-CD/front-cover-1-small.jpg index 01cf2de..543d9d9 100644 Binary files a/images/2017-12-28-G4-Cube-CD/front-cover-1-small.jpg and b/images/2017-12-28-G4-Cube-CD/front-cover-1-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/front-cover-1.jpg b/images/2017-12-28-G4-Cube-CD/front-cover-1.jpg index dc1d5f1..2daa933 100644 Binary files a/images/2017-12-28-G4-Cube-CD/front-cover-1.jpg and b/images/2017-12-28-G4-Cube-CD/front-cover-1.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/front-cover-2-small.jpg b/images/2017-12-28-G4-Cube-CD/front-cover-2-small.jpg index 25a1036..1c48530 100644 Binary files a/images/2017-12-28-G4-Cube-CD/front-cover-2-small.jpg and b/images/2017-12-28-G4-Cube-CD/front-cover-2-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/front-cover-2.jpg b/images/2017-12-28-G4-Cube-CD/front-cover-2.jpg index 0f7f297..ee7ab07 100644 Binary files a/images/2017-12-28-G4-Cube-CD/front-cover-2.jpg and b/images/2017-12-28-G4-Cube-CD/front-cover-2.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/inside-1-small.jpg b/images/2017-12-28-G4-Cube-CD/inside-1-small.jpg index 222a12e..5e739aa 100644 Binary files a/images/2017-12-28-G4-Cube-CD/inside-1-small.jpg and b/images/2017-12-28-G4-Cube-CD/inside-1-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/inside-1.jpg b/images/2017-12-28-G4-Cube-CD/inside-1.jpg index a168c19..70e43f3 100644 Binary files a/images/2017-12-28-G4-Cube-CD/inside-1.jpg and b/images/2017-12-28-G4-Cube-CD/inside-1.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/inside-2-small.jpg b/images/2017-12-28-G4-Cube-CD/inside-2-small.jpg index b323a6b..a239953 100644 Binary files a/images/2017-12-28-G4-Cube-CD/inside-2-small.jpg and b/images/2017-12-28-G4-Cube-CD/inside-2-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/inside-2.jpg b/images/2017-12-28-G4-Cube-CD/inside-2.jpg index 4c13391..502ef59 100644 Binary files a/images/2017-12-28-G4-Cube-CD/inside-2.jpg and b/images/2017-12-28-G4-Cube-CD/inside-2.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/retract-gears-1-small.jpg b/images/2017-12-28-G4-Cube-CD/retract-gears-1-small.jpg index 6abdfac..a21edf8 100644 Binary files a/images/2017-12-28-G4-Cube-CD/retract-gears-1-small.jpg and b/images/2017-12-28-G4-Cube-CD/retract-gears-1-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/retract-gears-1.jpg b/images/2017-12-28-G4-Cube-CD/retract-gears-1.jpg index b771b51..192cb40 100644 Binary files a/images/2017-12-28-G4-Cube-CD/retract-gears-1.jpg and b/images/2017-12-28-G4-Cube-CD/retract-gears-1.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/retract-gears-2-small.jpg b/images/2017-12-28-G4-Cube-CD/retract-gears-2-small.jpg index 89dfd9f..b296d96 100644 Binary files a/images/2017-12-28-G4-Cube-CD/retract-gears-2-small.jpg and b/images/2017-12-28-G4-Cube-CD/retract-gears-2-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/retract-gears-2.jpg b/images/2017-12-28-G4-Cube-CD/retract-gears-2.jpg index a2967d4..6983b3d 100644 Binary files a/images/2017-12-28-G4-Cube-CD/retract-gears-2.jpg and b/images/2017-12-28-G4-Cube-CD/retract-gears-2.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-1-small.jpg b/images/2017-12-28-G4-Cube-CD/roller-1-small.jpg index e9caa58..03fdea7 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-1-small.jpg and b/images/2017-12-28-G4-Cube-CD/roller-1-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-1.jpg b/images/2017-12-28-G4-Cube-CD/roller-1.jpg index cb9ecbb..3e89b1e 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-1.jpg and b/images/2017-12-28-G4-Cube-CD/roller-1.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-2-small.jpg b/images/2017-12-28-G4-Cube-CD/roller-2-small.jpg index 594b3b2..3bdbd94 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-2-small.jpg and b/images/2017-12-28-G4-Cube-CD/roller-2-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-2.jpg b/images/2017-12-28-G4-Cube-CD/roller-2.jpg index d46e35c..01557ec 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-2.jpg and b/images/2017-12-28-G4-Cube-CD/roller-2.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-3-small.jpg b/images/2017-12-28-G4-Cube-CD/roller-3-small.jpg index 9a11236..8ba4e93 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-3-small.jpg and b/images/2017-12-28-G4-Cube-CD/roller-3-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-3.jpg b/images/2017-12-28-G4-Cube-CD/roller-3.jpg index dbd4186..fcef6d4 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-3.jpg and b/images/2017-12-28-G4-Cube-CD/roller-3.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-4-small.jpg b/images/2017-12-28-G4-Cube-CD/roller-4-small.jpg index 3d7addc..b57b4c5 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-4-small.jpg and b/images/2017-12-28-G4-Cube-CD/roller-4-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-4.jpg b/images/2017-12-28-G4-Cube-CD/roller-4.jpg index 71162af..120c664 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-4.jpg and b/images/2017-12-28-G4-Cube-CD/roller-4.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-5-small.jpg b/images/2017-12-28-G4-Cube-CD/roller-5-small.jpg index 16f1a11..975243a 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-5-small.jpg and b/images/2017-12-28-G4-Cube-CD/roller-5-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-5.jpg b/images/2017-12-28-G4-Cube-CD/roller-5.jpg index 39a1280..eca8dee 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-5.jpg and b/images/2017-12-28-G4-Cube-CD/roller-5.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-6-small.jpg b/images/2017-12-28-G4-Cube-CD/roller-6-small.jpg index f50351a..094e50a 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-6-small.jpg and b/images/2017-12-28-G4-Cube-CD/roller-6-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-6.jpg b/images/2017-12-28-G4-Cube-CD/roller-6.jpg index 2410da5..2b4c99e 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-6.jpg and b/images/2017-12-28-G4-Cube-CD/roller-6.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-motion-1-small.jpg b/images/2017-12-28-G4-Cube-CD/roller-motion-1-small.jpg index 62fd9ab..2257905 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-motion-1-small.jpg and b/images/2017-12-28-G4-Cube-CD/roller-motion-1-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-motion-1.jpg b/images/2017-12-28-G4-Cube-CD/roller-motion-1.jpg index 24057ce..612cd50 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-motion-1.jpg and b/images/2017-12-28-G4-Cube-CD/roller-motion-1.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-motion-2-small.jpg b/images/2017-12-28-G4-Cube-CD/roller-motion-2-small.jpg index 59c5fec..2b72cb3 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-motion-2-small.jpg and b/images/2017-12-28-G4-Cube-CD/roller-motion-2-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-motion-2.jpg b/images/2017-12-28-G4-Cube-CD/roller-motion-2.jpg index 669b46b..2dcf117 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-motion-2.jpg and b/images/2017-12-28-G4-Cube-CD/roller-motion-2.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-motion-3-small.jpg b/images/2017-12-28-G4-Cube-CD/roller-motion-3-small.jpg index ae74be7..f79a12e 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-motion-3-small.jpg and b/images/2017-12-28-G4-Cube-CD/roller-motion-3-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-motion-3.jpg b/images/2017-12-28-G4-Cube-CD/roller-motion-3.jpg index a30129c..fe68f56 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-motion-3.jpg and b/images/2017-12-28-G4-Cube-CD/roller-motion-3.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-springs-1-small.jpg b/images/2017-12-28-G4-Cube-CD/roller-springs-1-small.jpg index 00832c2..b4ffe98 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-springs-1-small.jpg and b/images/2017-12-28-G4-Cube-CD/roller-springs-1-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-springs-1.jpg b/images/2017-12-28-G4-Cube-CD/roller-springs-1.jpg index b1bc7fa..87813a8 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-springs-1.jpg and b/images/2017-12-28-G4-Cube-CD/roller-springs-1.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-springs-2-small.jpg b/images/2017-12-28-G4-Cube-CD/roller-springs-2-small.jpg index 95ec66a..778ac92 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-springs-2-small.jpg and b/images/2017-12-28-G4-Cube-CD/roller-springs-2-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-springs-2.jpg b/images/2017-12-28-G4-Cube-CD/roller-springs-2.jpg index 6701a90..5af8b12 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-springs-2.jpg and b/images/2017-12-28-G4-Cube-CD/roller-springs-2.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-springs-3-small.jpg b/images/2017-12-28-G4-Cube-CD/roller-springs-3-small.jpg index 8689170..44455c7 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-springs-3-small.jpg and b/images/2017-12-28-G4-Cube-CD/roller-springs-3-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/roller-springs-3.jpg b/images/2017-12-28-G4-Cube-CD/roller-springs-3.jpg index 943b31f..b8ab4ec 100644 Binary files a/images/2017-12-28-G4-Cube-CD/roller-springs-3.jpg and b/images/2017-12-28-G4-Cube-CD/roller-springs-3.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/spindle-small.jpg b/images/2017-12-28-G4-Cube-CD/spindle-small.jpg index cf7a880..79348fa 100644 Binary files a/images/2017-12-28-G4-Cube-CD/spindle-small.jpg and b/images/2017-12-28-G4-Cube-CD/spindle-small.jpg differ diff --git a/images/2017-12-28-G4-Cube-CD/spindle.jpg b/images/2017-12-28-G4-Cube-CD/spindle.jpg index 8d81ea1..4db9281 100644 Binary files a/images/2017-12-28-G4-Cube-CD/spindle.jpg and b/images/2017-12-28-G4-Cube-CD/spindle.jpg differ diff --git a/images/2019-5-4-Photorealistic-Particles/effects.mp4 b/images/2019-5-4-Photorealistic-Particles/effects.mp4 new file mode 100644 index 0000000..d092a72 Binary files /dev/null and b/images/2019-5-4-Photorealistic-Particles/effects.mp4 differ diff --git a/images/2019-5-4-Photorealistic-Particles/flipbook.png b/images/2019-5-4-Photorealistic-Particles/flipbook.png new file mode 100644 index 0000000..f6cfdf8 Binary files /dev/null and b/images/2019-5-4-Photorealistic-Particles/flipbook.png differ diff --git a/images/2019-5-4-Photorealistic-Particles/potato-rock.png b/images/2019-5-4-Photorealistic-Particles/potato-rock.png new file mode 100644 index 0000000..6e0762f Binary files /dev/null and b/images/2019-5-4-Photorealistic-Particles/potato-rock.png differ diff --git a/images/2019-5-4-Photorealistic-Particles/setup-small.jpg b/images/2019-5-4-Photorealistic-Particles/setup-small.jpg new file mode 100644 index 0000000..7fd36f2 Binary files /dev/null and b/images/2019-5-4-Photorealistic-Particles/setup-small.jpg differ diff --git a/images/2019-5-4-Photorealistic-Particles/setup.jpg b/images/2019-5-4-Photorealistic-Particles/setup.jpg new file mode 100644 index 0000000..9f2c406 Binary files /dev/null and b/images/2019-5-4-Photorealistic-Particles/setup.jpg differ