tag:blogger.com,1999:blog-52091173834556521312024-03-17T23:03:29.706-07:00//game dev log of martins upitismartinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.comBlogger57125tag:blogger.com,1999:blog-5209117383455652131.post-11094422378343798802019-04-21T06:10:00.001-07:002019-04-21T06:10:27.074-07:00//MediumI am moving to medium.<br /><br /><a href="https://medium.com/@martinsupitis">https://medium.com/@martinsupitis</a><br /><br />I imported an older post and wrote a new one. It feels much easier to maintain and write stories there.martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com2tag:blogger.com,1999:blog-5209117383455652131.post-47448485537668350772019-04-16T08:43:00.000-07:002019-04-16T08:43:13.642-07:00//and another year later<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Not much has changed - still too lazy to post any update weekly, nor monthly.<br /><br />Now when Blender Game Engine is officialy removed from Blender 2.8x and up, I amrevisiting my old BGE projects and concepts, polishing and adding comments and archiving them in a proper way. UPBGE is still actively developed and I occasionally use it for an art project or a prototype.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;"><br />part 1 - <span style="background-color: white; color: var(--ytd-video-primary-info-renderer-title-color, var(--yt-spec-text-primary));">volume rendering GLSL shader</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/dX84nYxE63w/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/dX84nYxE63w?feature=player_embedded" width="320"></iframe></div>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;"><br /></span><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">part 2 - </span><span style="background-color: white; font-family: "roboto" , "arial" , sans-serif; font-size: x-small;">spherical penumbra shadows</span><br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/lzwpJUbO5eA/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/lzwpJUbO5eA?feature=player_embedded" width="320"></iframe></div>
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">part 3 - vertex shader shadows</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/JPGmO9qvcA4/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/JPGmO9qvcA4?feature=player_embedded" width="320"></iframe></div>
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">next parts have lined up. here are some teasers:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/AAzXwH5tAOs/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/AAzXwH5tAOs?feature=player_embedded" width="320"></iframe></div>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;"><br /><br /><br />https://www.shadertoy.com/view/tdlSRr</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">https://www.shadertoy.com/view/tdj3Ww</span><br />
<br />
--------------<br />
<br />
//I`m Moving to Medium, as an experiment.<br />I will be transferring some of my old posts there too, but my blogspot stays as a backup, if i hate it and want to come back here.<br />
<br />
<br />martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com3tag:blogger.com,1999:blog-5209117383455652131.post-61421105028347118312018-01-08T15:49:00.001-08:002018-01-09T04:34:34.679-08:00Game worlds and Flat Earth theory<br />
<h4>
OK, this is a fun one.</h4>
<div>
I have other blog posts in progress, but idea struck me unprepred and I wrote this in record speed.</div>
So i`ve been obsessed by articles of theories that considers our world to be flat. Initially I thought they were sarcasm or jokes, but more research I did, more I realized how serious the topic is considered by some individuals.<br />
I`m going to analyze here only my own fascination with them, not judge their ideas and reasons.<br />
<br />
If you don`t know about them, here, have a read, it`s crazy:<br />
<a href="https://theflatearthsociety.org/home/">https://theflatearthsociety.org/home/</a><br />
<a href="https://www.tfes.org/">https://www.tfes.org/</a><br />
<a href="https://wiki.tfes.org/The_Flat_Earth_Wiki">https://wiki.tfes.org/The_Flat_Earth_Wiki</a><br />
<br />
<h4>
why do I care? </h4>
<div>
<br /></div>
Vast majority of us don`t actually care if world is round or flat or cube or pear shaped. We are dealing with daily issues and don`t trouble ourselves wondering about how world works. I do care and think it is important to question everything. But this is not the reason why Flat Earthers caught my attention.<br />
<br />
I make worlds every now and then. For simulators, games, personal experiments, research and so on. These game worlds mostly are crude approximations based on our own to simulate environment we experience on Earth. I place my objects in it and they are lit by Sun and the sky. I tend to specify the requirements for the game world before I start the project, mostly based on complexity of simulation I need. <br />
<br />
Few of those are planetary scale. For these occasions I make a sphere, add an atmosphere, place a Sun and Moon in the right distance, add an orbit. Add a point based gravity to stick objects to the ground. Voila - a world like our own is ready, with working day/night cycle, stars, Moon phases. There are a lot of "hacks" and tricks involved to render planets from the distance, to be able to land and walk on them, so I tend not to complicate things too much.<br />
Now, most of the time I don`t need a whole planet. Many of my projects are grounded and I need only a small portion of flat surface, sky and a Sun. It would be a waste of performance to render the whole globe otherwise.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://www.dropbox.com/s/olz778fjkky21ld/planet_5.jpg?raw=1" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="438" data-original-width="800" height="218" src="https://www.dropbox.com/s/olz778fjkky21ld/planet_5.jpg?raw=1" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">spherical game world</td></tr>
</tbody></table>
<br />
<br />
In this case I consider our game world to be flat, which for the most part is easier to render and manipulate. This is how many 3D games have been made, and even till now game engines are only optimized for flat worlds. There are few exceptions, but in general - planetary scale is pain in the ass to maintain and operate. On the other hand flat and stationary world is more intuitive for an artist to understand, more stable for the program to predict and so naturally our games and creations use Flat Earth`s simplified physics laws. This is where I found similarities in interests of myself and those of Flat Earthers. Even more interesting - they are facing some of the same problems as I am when defining my flat worlds!<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://www.dropbox.com/s/f5cnanrg4pey1o3/Screenshot%202015-01-28%2017.08.37.png?raw=1" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="450" data-original-width="800" height="225" src="https://www.dropbox.com/s/f5cnanrg4pey1o3/Screenshot%202015-01-28%2017.08.37.png?raw=1" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">flat game world</td></tr>
</tbody></table>
<br />
<br />
<h4>
am I a Flat Earther in my profession?!</h4>
<br />
So in a sense, Flat Earthers are too making their "game" world. What I mean is that they disregard most existing modern laws of physics because those are not required for their world to work, but still their belief is based on real world observations. This is exaclty what I do!! I have made my worlds optimized, so I need to invent shaders and functions to replicate or re-shape spherical world effects on a flat game world.<br />
<br />
Digging through their publications and explanations of optimized flat Earth, I have found some interesting techniques in regards of skydome rendering using atmospheric lensing, they`ve gave me some ideas mapping clouds on planar surfaces to look spherical and idea of <a href="https://wiki.tfes.org/The_Lunar_Eclipse">invisible ghost objects</a> that cast only shadow is hilariously similar what digital worlds allow. I will be closely following their latest publications and approaches in non-traditional thinking and might even credit them for upcoming shaders.<br />
<br />
<br />martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com4tag:blogger.com,1999:blog-5209117383455652131.post-34834270039855383382017-11-05T07:44:00.002-08:002017-11-05T07:44:22.578-08:002 years later<div class="separator" style="clear: both; text-align: center;">
<br /></div>
Hi, all.<br /><br />So first of all - images in all of forums i`ve posted are gone - 404<br />I hosted all of the resources and images mostly on Dropbox, now that Dropbox has changed how their stuf works, the links are broken, so now my duty is to fix it all. Which also means I need to go back in time and re-visit most of the resources I have shared and see if they still work.<br /><br />Secondly, I have promised myself to start maintaining my blog more often. And share my thoughts on stuff in weekly basis. Will see how it goes. All of my old projects are still alive and I am going to continue them. There`s a new project I`ve been working on many years and I recently published it. So next blog post is about it.<br /><br /><a href="https://www.dropbox.com/s/ytmadd0lgqq8kbi/woop.jpg?raw=1" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="441" data-original-width="800" height="352" src="https://www.dropbox.com/s/ytmadd0lgqq8kbi/woop.jpg?raw=1" width="640" /></a>martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com6tag:blogger.com,1999:blog-5209117383455652131.post-69332003386130512672015-01-06T08:28:00.001-08:002017-11-05T07:19:45.363-08:00//status update 05 & a sneak peek in 2015!My previous post was a bit more than a year ago... well the good thing is that since then I have a collected pile of projects and other stuff to share. <br />
None of them are finished though, maybe that`s why I felt they are not shareworthy..<br />
<br />
Anyway, I have moved from France back to Latvia and settled down for a while. I am still working full time with Blender & also Blender Game Engine on supersecret projects of which I can`t show anything yet. So I can only share with you things I am working on my spare time.<br />
<br />
So, here is a list of projects I am planning to work on and hopefully finish this year. For each of these projects I will write a separate article explaining the details:<br />
<br />
<h4>
RGP (racing game project):</h4>
almost all of the effects, shaders and new stuff is related to RGP. I am now building up sort of a base to build the game on. The lighting and shading system is almost done, what yet needs to be finished is the physics, handling and collision system. After that I can finally focus on the content, story and gameplay.<br />
<br />
<h4>
PBR (physically based rendering):</h4>
RGP will be rendered using new lighting system. I am now in research and prototyping stage. Basics are functional and it looks really nice already. <br />
featuring:<br />
- new sky model<br />
- image based lighting (IBL) using environment map<br />
- real time environment map based on sky model or surrounding scene.<br />
- some advanced BRDF functions<br />
<br />
<h4>
Terrain system to render vast landscapes (also needed for RGP).</h4>
<div>
- uses adaptive LoD<br />
- infinite procedurally generated landscapes</div>
<div>
<br /></div>
<h4>
Continue the work on my water shader. I am still planning to implement it in Unity. </h4>
<div>
- combined with the new terrain system</div>
<div>
- combined with physically based rendering system</div>
<div>
<br /></div>
<h4>
Advanced buoyancy system for water shader.</h4>
<div>
- calculate buoyancy forces for each object submerged in water</div>
<div>
<br /></div>
<h4>
Tron lightcycle game, yep still in progress.. I am doing a full re-write of the scripts.</h4>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
- port all of the code from old Blender versions to Blender 2.7<br />
<br /></div>
<a href="https://dl.dropboxusercontent.com/u/11542084/quadtree.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br />
</a> <a href="https://dl.dropboxusercontent.com/u/11542084/rgpai.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br />
</a> <a href="https://dl.dropboxusercontent.com/u/11542084/reflection_3.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br />
</a> <a href="https://dl.dropboxusercontent.com/u/11542084/reflection_2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br />
</a>martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com35tag:blogger.com,1999:blog-5209117383455652131.post-28724245224367688202013-11-24T15:59:00.001-08:002013-11-25T01:59:50.870-08:00water/underwater & sky shader update #03Yep, I haven`t been very active blogger lately.<br />
I am very glad that company I am working for brought me to Amsterdam to Blender Conference this year. I even did a presentation there together with my colleague Michael Otto about GLSL shaders in Blender Game Engine. And for the presentation purposes I decided to demo my water/underwater shader there.<br />
Just before the presentation I managed to tune up the shader and the scenery a bit.<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="390" src="http://www.youtube.com/embed/nv89chmj6b4" width="700"></iframe><br />
<br />
<br />
so the changes since last update are:<br />
- projected grid approach for the water surface (lousy implementation)<br />
- per-vertex displacement mapping for waves<br />
- basic but effective shoreline detection for water surface and ground<br />
- added some subtle cloud layer and stars in the skies<br />
<br />
yet to be done:<br />
- fixes on inconsistencies<br />
- better and procedural wave propagation model<br />
- focus to underwater visuals<br />
- better camera transition from water/underwater<br />
- better coastline behaviors<br />
- buoyancy (partly done)<br />
- heavy optimization<br />
- when it`s done, as many have requested - implement in Unity<br />
<br />
trees are generated with <a href="http://www.frecle.net/?show=treed.about">tree[d] by frecle</a><br />
<br />
blend file to be uploaded (have to clean and optimize the code a bit)martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com29tag:blogger.com,1999:blog-5209117383455652131.post-39785481461932063792013-09-13T03:45:00.000-07:002013-09-13T03:45:59.073-07:00water/underwater & sky shader update #02I publish<span style="font-family: inherit;">ed this quite a</span> while ago, but found some time to post it here just now.<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="390" src="//www.youtube.com/embed/UkskiSza4p0" width="700"></iframe><br />
<br />
This is an update video to one of my oldest projects in the making.<br />
nothing much has changed since the last video, I just have a better computer now and I recorded it in a higher quality and framerate.<br />
<br />
The water shader is based on my own observations.<br />
it features:<br />
- reflection with accurate fresnel refectance model<br />
- refraction with chromatic aberration<br />
- projected caustics on geometry from the water surface based on normals<br />
- seamless transition to underwater (no fake fog added)<br />
- accurate water volume with light scattering<br />
- view and light ray color extinction based on water color and sunlight<br />
- simple coastline detection based on terrain`s height-map<br />
<br />
does not yet feature:<br />
- displaced water geometry<br />
- underwater particles<br />
- underwater light rays from caustics<br />
- shoreline behaviors<br />
<br />
Sky model is based on Preetham, but implementation is from Simon Wallner, with a significant (artistic) changes done by myself.<br />
<br />
I have also included an overly exaggerated experimental glitter shader and a completely procedural "water droplets on lens" shader.<br />
<br />
YES the underwater distortion is completely unrealistic and will be removed once I add underwater particles that will wobble similarly.<br />
<br />
download blend:<br />
- <a href="https://dl.dropboxusercontent.com/u/11542084/water_0.99_optimized.blend">https://dl.dropboxusercontent.com/u/11542084/water_0.99_optimized.blend</a><br />
- <a href="http://www.blendswap.com/blends/view/68857">http://www.blendswap.com/blends/view/68857</a><br />
<br />
sound files from freesounds.org<br />
<div>
<br /></div>
martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com18tag:blogger.com,1999:blog-5209117383455652131.post-4488587376200209052013-05-15T05:19:00.003-07:002017-11-05T11:20:27.809-08:00image imperfections and Film Grain post process FXIt`s been a while already since game studios try to replicate lens and film camera effects to enhance the visual fidelity for their games. Most of the time it does not make much sense to see them from the perspective of the player, but nonetheless it does look nice if done right.<br />
I am talking about lens flares, vignetting and chromatic aberration, depth of field, bloom effects and film noise/grain. In photography or film they are considered as visual artifacts caused by imperfections and properties of film and lenses and mainly - the physics behind optics. Most of photo/cinemato-graphers do their best to avoid them by using better lenses and lens hoods to reduce vignetting, lens flares and chromatic aberration and use different sensitivity films for appropriate scenes to reduce image noisiness so in the end they get as clear image as possible that is usable for editing - tracking, compositing or whatever they do.. In the gaming industry it is pretty opposite - renderer outputs a perfectly clear image and artists do whatever they can to make it imperfect.<br />
<br />
Few years ago these effects were done with some moving view-aligned textures, but now with clever shader tricks we can fairly accurate simulate them as an image post-process effects.<br />
<br />
I have re-created most of these effects already and posted results in my blog. Links:<br />
<a href="http://devlog-martinsh.blogspot.com/2011/10/glsl-cubic-lens-distortion.html">lens distortion</a><br />
<a href="http://artmartinsh.blogspot.com/2010/02/glsl-lens-blur-filter-with-bokeh.html">lens blur with bokeh v1</a><br />
<a href="http://devlog-martinsh.blogspot.fr/2011/11/glsl-depth-of-field-with-bokeh-v21.html">dof with bokeh v2.1</a><br />
<a href="http://devlog-martinsh.blogspot.com/2012/10/status-update-04-rgp-day-8.html">lens flare</a><br />
<br />
And here are very nice results from other guys<br />
<br />
<a href="http://www.mpi-inf.mpg.de/resources/lensflareRendering/">Lens Flare by Max Planck Institut Informatik</a><br />
<a href="http://john-chapman-graphics.blogspot.com/2013/02/pseudo-lens-flare.html">Lens Flare by John Chapman</a><br />
<a href="http://udn.epicgames.com/Three/BokehDepthOfField.html">DoF with bokeh by Epic Games</a><br />
<a href="http://mynameismjp.wordpress.com/2011/02/28/bokeh/">DoF with bokeh by Matt Pettineo (MJP)</a><br />
<br />
<b>Film Grain..</b><br />
..is the reason why I am writing this post here right now.<br />
<br />
<a href="http://en.wikipedia.org/wiki/Film_grain">Film grain</a> is a texture on the photographic film caused by an emulsion containing photon sensitive silver halide salt crystals. They are sort of pixels of the <a href="http://en.wikipedia.org/wiki/Photographic_film">photographic film</a>. Depending of the size of the crystals varies the resolution and sensitivity of the film. Bigger the particle (higher ISO number), higher the light sensitivity, but the image is less detailed. Unlike the digital image sensor where light sensing pixels are arranged in a regular grid, film crystals are jittered randomly over the film which gives an image more pleasing for the human eye. The possible reason for that might be the fact that the film grain does resemble the pattern how the <a href="http://en.wikipedia.org/wiki/Photosensitive_ganglion_cell">photoreceptors</a> are arranged in the retina of the human eye. Awesome, right?<br />
<br />
photoreceptors in human eye (source <a href="http://www.sciencecodex.com/historic_first_images_of_rod_photoreceptors_in_the_living_human_eye">http://www.sciencecodex.com</a>):<br /><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.dropbox.com/s/bdzs4r6yud151u9/32970_web.jpg?raw=1" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="400" height="200" src="https://www.dropbox.com/s/bdzs4r6yud151u9/32970_web.jpg?raw=1" width="400" /></a></div>
<br />
<br />
<br />
an extreme case of color film grain (source <a href="http://en.wikipedia.org/wiki/Film_grain">Wikipedia.com</a>):<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.dropbox.com/s/9omwo94m9zek82a/MartinIversenNorway1991.jpg?raw=1" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="448" data-original-width="700" src="https://www.dropbox.com/s/9omwo94m9zek82a/MartinIversenNorway1991.jpg?raw=1" /></a></div>
<br />
<br />
Now in the digital era of cinematography most movies are shot digitally, that`s why often the film grain effect is artificially added on digital image. Many of the Blu-ray movies have a very distinct graininess, which actually gives a nice high-def cinematic feeling.<br />
So exactly the same should apply to computer games.<br />
<br />
Film Grain does seem to be the least difficult to simulate compared to other lens effects, but surprisingly I have not yet seen any convincing real-time implementation that does resemble, for example, the nice granularity look of 35mm film. Well the best examples of film grain effect I found used in games are by Crytek and Valve software - Crysis Warhead/Crysis2 and L4D series to be specific. Unfortunately the effect can hardly be called "film grain", it is rather an overlay noise that makes the appearance of slight jitter. What they did right is the elusiveness of the effect. Increase the grain amount a little bit more and it gets annoying. For many game titles film grain effect bothered me so much I disabled it completely (if there was an option at all). Mass Effect was one of them, in fact in darker scenes it looked nice, but in highlights made the image look dull and dirty. It did a good job covering up some less detailed textures and models though.<br />
<br />
The possible reason why film grain does not seem to have advanced over the years like other effects might be that the grain filter is so subtle the developers do not bring much attention to it. And why waste time, money and precious milliseconds of computing time to create an effect most gamers would never notice. Well, here exactly lies the problem - overdone effects. Most notorious are <a href="http://en.wikipedia.org/wiki/Bloom_(shader_effect)">Bloom</a>, <a href="http://en.wikipedia.org/wiki/Screen_space_ambient_occlusion">SSAO</a>, DoF and yeah.. Film Grain and they are certainly very easy to overdo.<br />
Personally I love subtle details. For me the best effects are the ones that enhances the visual quality while not bothering me with its presence during gameplay.<br />
And there is another point - high ISO film photograph can get very grainy but the image looks nice and natural, while a bit overdone film grain effect in game ruins any viewing pleasure.. So the problem lies in the technique which generates the grain pattern and mixes it with the scene image.<br />
<br />
<b>Approaches</b><br />
<br />
The common methods of simulating it in games are either using a real grain texture or computing a noise pattern procedurally in runtime and then mixing them with the rendered image.<br />
<br />
Pre-computed texture approach might make the best results as you can use actual grain texture taken on real film (filming against a grey background) and then overlaying this image to game scene. the downside is that it needs to be different in every frame. You can offset it a little and tile it, but a trained eye will always notice the tiling and this can make the effect very annoying. The approach does work best for still shots.<br />
<br />
Procedural approach will ensure the grain will never tile, but the result is actually a noise and does not resemble the granularity of film grain at all. It does look more like a digital sensor noise. One might actually misinterpret it for an interference of the video signal to the monitor.<br />
<br />
<b>My take on Film Grain effect</b><br />
<br />
All the time I have been using the procedural noise approach which is fast and gives nice results if the noise amount is very little, but as I mentioned it looks more like an interference in video signal.<br />
After doing some research in this matter I collected bunch of reference images taken with film camera. I extracted the noise pattern from them and compared it to the noise shader I have been using. As you see it is lacking the graininess of the real thing.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.dropbox.com/s/3xmlep7zujinkaz/grain_noise.jpg?raw=1" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="300" data-original-width="600" src="https://www.dropbox.com/s/3xmlep7zujinkaz/grain_noise.jpg?raw=1" /></a></div>
<br />
<br />
I opened the image of my noise shader in Photoshop and tried to replicate the real grain texture. Blurring a little and adding 3 passes of sharpening did actually the trick. Unfortunately doing that for full-screen texture in shader would significantly slow the process and make it unusable in real-time.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.dropbox.com/s/z0vrkxud7m2fzi4/grain_noiseblur.jpg?raw=1" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://www.dropbox.com/s/z0vrkxud7m2fzi4/grain_noiseblur.jpg?raw=1" /></a></div>
<br />
<br />
<br />
So now I had to find a procedural or semi-procedural approach to simulate the same pattern in the shader without having to blur or rendering it in multiple passes.<br />
Few years ago I did a vertex displacement mapping experiments with a procedural <a href="http://en.wikipedia.org/wiki/Simplex_noise">Simplex noise</a> algorithm which created a nice grainy pattern. I resurrected the shader and applied it to a grey color and here is the result:<br /><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.dropbox.com/s/6fsx90owo11jyel/grain_simplex.jpg?raw=1" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="300" data-original-width="600" src="https://www.dropbox.com/s/6fsx90owo11jyel/grain_simplex.jpg?raw=1" /></a></div>
<br /><br />
<br />
<br />
That is a really pleasant uniform grain. It is lacking a bit of the randomness but otherwise I call this a success!<br />
<br />
Comparison shots of noise and grain applied to a gradient.<br />
<br />
noise:<br /><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.dropbox.com/s/gqksg3u0oofow9m/grain_grad_noise.jpg?raw=1" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="528" data-original-width="528" src="https://www.dropbox.com/s/gqksg3u0oofow9m/grain_grad_noise.jpg?raw=1" /></a></div>
<br />
simplex grain:<br /><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.dropbox.com/s/wvx36pjih85m2kh/grain_grad_simplex.jpg?raw=1" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="528" data-original-width="528" src="https://www.dropbox.com/s/wvx36pjih85m2kh/grain_grad_simplex.jpg?raw=1" /></a></div>
<br />
<br />
<br />
<b>Results</b><br />
<br />
There is yet long way to go for more accurate results. It could be extended to include the real science behind it like varying graininess based on camera`s relative aperture. But I am only an artist so I go by whatever looks the best :)<br />
This whole thing is a work in process, but I feel that even at this stage it looks already better than many other real-time film grain shaders. As you see the grain is not making the image look dull. It is less visible at bright areas of the image, but more noticeable in darker shades. An option to change the grain size is yet to be done.<br />
<br />
Perlin noise grain applied in CryEngine (big images):<br />
<a href="https://dl.dropboxusercontent.com/u/11542084/crysis_grain_01.jpg">screenshot 1</a><br />
<a href="https://dl.dropboxusercontent.com/u/11542084/crysis_grain_02.jpg">screenshot 2</a><br />
<a href="https://dl.dropboxusercontent.com/u/11542084/crysis_grain_03.jpg">screenshot 3</a><br />
<br />
100% crops from the shots above:<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.dropbox.com/s/kygu8d978wc9xnl/crysis_grain_crop_2.jpg?raw=1" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="512" data-original-width="700" src="https://www.dropbox.com/s/kygu8d978wc9xnl/crysis_grain_crop_2.jpg?raw=1" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.dropbox.com/s/j8z1u19io7x8ce0/crysis_grain_crop_0.jpg?raw=1" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="512" data-original-width="700" src="https://www.dropbox.com/s/j8z1u19io7x8ce0/crysis_grain_crop_0.jpg?raw=1" /></a></div>
<br />
<b>Continuing</b><br />
<br />
today during further grain shader development I tried to replicate the grain in the image with the rally car. I had to de-noise the original image with resulted in some loss of detail. Then I applied the new grain shader on it. Here is the result:<br />
<br />
original:<br />
<br />
<a href="https://www.dropbox.com/s/9omwo94m9zek82a/MartinIversenNorway1991.jpg?raw=1" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="448" data-original-width="700" src="https://www.dropbox.com/s/9omwo94m9zek82a/MartinIversenNorway1991.jpg?raw=1" /></a><br />
de-noised and artificially added film grain shader:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.dropbox.com/s/p8crvw0vepbdev5/grain_better.jpg?raw=1" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="448" data-original-width="700" src="https://www.dropbox.com/s/p8crvw0vepbdev5/grain_better.jpg?raw=1" /></a></div>
<br />
real film grain compared to new film grain shader:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.dropbox.com/s/8du86k42xdt8ms4/film_grain_compare_new.jpg?raw=1" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://www.dropbox.com/s/8du86k42xdt8ms4/film_grain_compare_new.jpg?raw=1" /></a></div>
<br />
There are some significant changes from the original shader:<br />
<br />
- user variable grain size<br />
- added varying coordinate orientation for noise pass to eliminate any directional artifacts<br />
- option to reduce grain based on luminance value<br />
- added more tweakables for color noise<br />
<br />
<b>downloads</b><br />
<br />
v1.0 (old one):<br />
<a href="https://www.dropbox.com/s/j476sv1ea1x3jg7/FilmGrain_v1.0?dl=0">HERE</a> you can find the GLSL shader file.<br />
<br />
v1.1:<br />
<a href="https://www.dropbox.com/s/8gamnswpdopottm/FilmGrain_v1.1?dl=0">HERE</a><br />
<br />
<br />
<span style="font-size: x-small;">References:</span><br />
<span style="font-size: x-small;">- noise algorithm I copied from <a href="http://machinesdontcare.wordpress.com/2009/06/25/3d-perlin-noise-sphere-vertex-shader-sourcecode/">HERE</a> by <a href="http://machinesdontcare.wordpress.com/">toneburst</a>, but original implementation comes from Stefan Gustavson found <a href="http://staffwww.itn.liu.se/~stegu/simplexnoise/">HERE</a></span>martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com19tag:blogger.com,1999:blog-5209117383455652131.post-83556498010675182932013-02-25T18:29:00.000-08:002013-02-26T05:47:17.379-08:00RGP day 15 - AI and a download linkSo, as promised, I am finally giving you something to play with.<br />
<br />
<b>AI</b><br />
I have added a very basic AI steering system and obstacle avoidance behaviors. I will write a more detailed article about it soon.<br />
<br />
<b>physics and handling</b><br />
I completely rewrote handling and physics system using real world laws of aerodynamics. It was a really nice exercise and gave me the basic understanding of movement, drag, acceleration, etc.<br />
The movement is now much smoother and the vehicle is very stable.<br />
all math came from here: <a href="http://physics.info/drag/">http://physics.info/drag/</a> & <a href="http://www.asawicki.info/Mirror/Car%20Physics%20for%20Games/Car%20Physics%20for%20Games.html">HERE</a><br />
I will write a more artist-friendly overview of the physics behind the game.<br />
<br />
<b>UI</b><br />
added subtle motion to the UI while steering<br />
<br />
<b>camera movement</b><br />
The camera is now more dynamic. FOV, height and distance from vehicle increases with the velocity.<br />
<br />
<b>post-process filters</b><br />
added a simple lens filter that distorts, blurs, creates vignette and adds some chromatic aberration near the edges of the viewport. I might make it react to the velocity as well.<br />
<br />
a video:<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="394" src="http://www.youtube.com/embed/WdDdCLCLJWE?list=UUp5ezqggf65RIbtv_Snq8lg" width="700"></iframe><br />
<br />
and a download link to blend: <a href="https://dl.dropbox.com/u/11542084/RGPv01.zip">https://dl.dropbox.com/u/11542084/RGPv01.zip</a><br />
<br />
Now I have to finish few projects, so this is probably last (RGP related) blog post in next few months.<br />
<placeholder download="" for="" here="" is="" link=""></placeholder>martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com12tag:blogger.com,1999:blog-5209117383455652131.post-31290543925959375772013-01-22T17:25:00.000-08:002013-01-26T12:07:44.591-08:00RGP day 10 - a bit of everythingFirst post in 2013, and I feel it is going to be a great year :]<br />
I know it`s been a while, but I am working on the game again!<br />
<br />
It is actually day 10 - 14 of the RGP. I worked on the project quite a lot, mostly tweaking the code to make it work just right. And finally here is also some visual stuff, while only sketchy, but something! So here is the stuff I`ve been busy these last 5 days.<br />
<br />
<b>physics and handling</b><br />
<br />
I`ve been collecting some useful resources regarding physics, acceleration & springs`n`dampers aswell as browsing through YouTube videos of Wipeout, F-Zero and other futuristic racing games. I believe now that a nice vehicle handling system will be actually much bigger challenge than I initially thought. I hoped I could stay with Blender`s built in Bullet physics & material properties in UI, but I just could not get the feel and handling right as well as it caused stability issues at high speeds. So I created my own system. Basically it consists of spring-damper system for vehicle suspension, engine system for thrust and turning and a very basic inertia and gravity system.<br />
<br />
<b>race track & vehicle</b><br />
<br />
I made a race track to push my physics system to the limits. Basically it is an oval loop with a twist - literally :). I created a race trac<span style="font-family: inherit;">k based </span>on <span style="background-color: white; line-height: 19.1875px;"><span style="font-family: inherit;"><a href="http://en.wikipedia.org/wiki/M%C3%B6bius_strip">Möbius strip</a> - </span></span><span style="background-color: white; line-height: 19.1875px;"><span style="font-family: inherit;"><span style="font-family: inherit;"><i>"</i></span></span></span><span style="background-color: white; line-height: 19.1875px;"><span style="font-family: inherit;"><i>A model can easily be created by taking a paper strip and giving it a half-twist, and then joining the ends of the strip together to form a loop". </i>So you are actually racing on the both sides of the race track.<i> </i>Also the oval in the middle is bent around 90degrees up which at high velocity, will create very high negative or positive centrifugal forces, so that the race car will be either pressed against racetrack surface or pulled off it. </span></span><span style="background-color: white; line-height: 19.1875px;">In the game speedways will have a </span><span style="background-color: white; line-height: 19.1875px;">gravitational force field which will keep the race cars from falling off the track either at high centrifugal forces or </span><span style="background-color: white; line-height: 19.1875px;">regardless if the track is upside down, so I think that this kind of racetrack configuration is perfect for testing and tweaking purposes.</span><br />
<span style="background-color: white; line-height: 19.1875px;"><br />
overview of the "Möbius race circuit"</span><br />
<span style="background-color: white; line-height: 19.1875px;"><br />
<a href="https://dl.dropbox.com/u/11542084/rgp_mobius_racetrack.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/rgp_mobius_racetrack.jpg" style="height: 394px; width: 700px;" /></a><br />
<br />
clearer view of the configuration</span><br />
<span style="background-color: white; line-height: 19.1875px;"> <br />
<a href="https://dl.dropbox.com/u/11542084/bent_mobius_track.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/bent_mobius_track.jpg" style="height: 394px; width: 700px;" /></a><br />
<span style="background-color: white; line-height: 19.1875px;"><br />
</span> <span style="background-color: white; line-height: 19.1875px;">This is a generic racecar you would find in similar racing games. As the rest of the game this is only a placeholder. More race car concept-art is on the way :)</span><br />
<br />
<a href="https://dl.dropbox.com/u/11542084/rgp_racecar.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/rgp_racecar.jpg" style="height: 394px; width: 700px;" /></a></span><br />
<br />
<b>UI</b><br />
<br />
This is the first time I am working with <a href="http://mogurijin.wordpress.com/">Moguri`s</a> <a href="https://code.google.com/p/bgui/">BGUI</a> - a graphical user interface (GUI) library for BGE. I have just started to mess around with it, so nothing much to see yet, but I intend to keep it simple and minimal, close to what you can see in the screenshots below.<br />
<br />
<b>Camera movement</b><br />
<br />
I worked also on the camera movement a little. A good setup can add a great amount of immersion into the game. Just parenting it to the race car`s chassis does not look good. I will do a deeper look at it sometime later.<br />
<br />
<b>Graphics & FX</b><br />
<b><br />
</b> Nothing fancy yet - a simple skylight setup like <a href="http://devlog-martinsh.blogspot.fr/2011/08/simple-and-efficient-skylight-setup.html">THIS</a>, completely texture baked terrain, simple fogging that gives an atmospheric feel. Exhaust trails are cross shaped , textured planes spawned each frame - I should find some more efficient way of doing them.<br />
<br />
<br />
screenshots showing all of this together which starts to form up the feel of an actual game:<br />
<br />
<a href="https://dl.dropbox.com/u/11542084/rgp_screen_06.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/rgp_screen_06.jpg" style="height: 371px; width: 700px;" /></a><br />
<br />
<a href="https://dl.dropbox.com/u/11542084/rgp_screen_02.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/rgp_screen_02.jpg" style="height: 371px; width: 700px;" /></a><br />
<br />
<a href="https://dl.dropbox.com/u/11542084/rgp_screen_03.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/rgp_screen_03.jpg" style="height: 371px; width: 700px;" /></a><br />
<br />
<a href="https://dl.dropbox.com/u/11542084/rgp_screen_01.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/rgp_screen_01.jpg" style="height: 371px; width: 700px;" /></a><br />
<br />
<a href="https://dl.dropbox.com/u/11542084/rgp_screen_05.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/rgp_screen_05.jpg" style="height: 371px; width: 700px;" /></a><br />
<br />
<a href="https://dl.dropbox.com/u/11542084/rgp_screen_04.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/rgp_screen_04.jpg" style="height: 371px; width: 700px;" /></a><br />
<br />
<strike>(I am having some difficulties with screen capture software working on Windows 8 so perhaps I will switch back to win7 to be able to make some videos)</strike><br />
<br />
Back to Win7 and video is here.<br />
<br />
<iframe width="700" height="394" src="http://www.youtube.com/embed/WTDOEVudDDw" frameborder="0" allowfullscreen></iframe><br />
<br />
blend file is on the way.<br />
<br />
martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com11tag:blogger.com,1999:blog-5209117383455652131.post-36304751715376705082012-11-16T04:48:00.003-08:002012-11-16T17:00:49.406-08:00BGE Candy - Area lightsI have a new PC computer and this is a milestone for the development for BGE and my racing game. Finally I can to some more quality screen capture, and the first ones to show you are - area lights!<br />
<br />
<iframe width="700" height="371" src="http://www.youtube.com/embed/3JUYFGkmE1Y" frameborder="0" allowfullscreen></iframe><br />
<br />
As soon as I saw Arkano22`s implementation of area lights in gamedev.net forums I knew Blender must have it in GE! This is a slightly modified version of Arkano22 technique, the biggest differences are the smoother light falloff and specular reflection glossiness variations based of the reflecting surface properties and distance, and of course - the texture support!<br />
<br />
video showing how to set-up them:<br />
<br />
<iframe width="700" height="371" src="http://www.youtube.com/embed/f8Foaf7u7Qk" frameborder="0" allowfullscreen></iframe><br />
<br />
win32 build: <a href="https://dl.dropbox.com/u/11542084/Blender246AreaBuild.zip">https://dl.dropbox.com/u/11542084/Blender246AreaBuild.zip</a>martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com19tag:blogger.com,1999:blog-5209117383455652131.post-15784252870039810392012-10-29T15:54:00.001-07:002017-11-05T07:13:55.137-08:00RGP day 9 - physicsSo today I am doing something completely different I've done so far - the physics system. It is the next big challenge aside from the track coordinates and AI.<br />
For collision detection and simpler stuff I will be relying on Blender's Bullet Physics system, but more advanced things - track space constraints, hover spring-damper system, vehicle handling and behaviors I will have to write from a scratch. And as an artist I am very good at it :P. Fortunately we have an Internet and there are a lot of really helpful resources for this.<br />
<br />
The first thing I tried to implement was a mass-spring-damper system. I will be using it to make the vehicles levitate above the ground/racetrack surface. The idea is to cast a ray from the vehicle's vertical axis down. If it collides with a surface the spring-damper simulation will run and apply the calculated force to the vehicle.<br />
The most helpful resource I found had an actual Blender Game Engine implementation already :). <a href="http://myinventions.pl/index.php?page=BlenderSpringsAndDampers">HERE</a> is the link where I found it. It is done by <a href="http://myinventions.pl/index.php?page=info">Sebastian Korczak</a>, same guy who is making the <a href="http://geta3d.com/">Burster</a> - a web browser plugin to allow publish and play Blender files online. I will be using it at one point of development to show off the progress.<br />
So after some changes I had a nice springy levitating box.<br />
<br />
Another thing I managed to create - a force field that will keep the race car close to speedway's surface, thus preventing the vehicle to fall off the track surface even if the speedway is oriented upside down.<br />
<br />
blend file <a href="https://dl.dropbox.com/u/11542084/springdampers.blend">HERE</a>martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com10tag:blogger.com,1999:blog-5209117383455652131.post-20359854873452534062012-10-28T12:07:00.000-07:002012-10-28T12:07:50.964-07:00shader based cube environment mappingI present you a pure shader based cube environment mapping. It might be useful for those who, for whatever reason, does not have "samplerCube" texture type support in their engine or want some more flexibility or customization for envmaps. It is a tiny bit slower than the proper version and mip-mapping is not working well, so it is pretty much useless.<br />This paper helped me a lot: <a href="http://www.cs.wustl.edu/~cmg/content/papers/jgt2007em/jgt2007em.pdf">http://www.cs.wustl.edu/~cmg/content/papers/jgt2007em/jgt2007em.pdf</a><br /><br />Anyways, the input can be 6 separate textures or cube environment map Blender style. A standard OpenGL style alignment is on the way.<br /><br />shader <a href="https://dl.dropbox.com/u/11542084/shaderCubeMapping">HERE</a><br /><br />screenshots are in previous post :)martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com5tag:blogger.com,1999:blog-5209117383455652131.post-32010047574425911832012-10-23T09:01:00.001-07:002012-11-16T05:23:39.117-08:00//status update 04 & RGP day 8Lots of good stuff has happened recently. I am waiting for my new custom laptop to get shipped from US, so finally I will be able to normally screencast the process of the development of my racing game ..and to actually play my game. As a real tech geek I will also write a short review of it :)<br />
Not much has happened to RGP since the last post and I believe the real process will start whenever I will be on my new rig.<br />
<br />
Here is the list of stuff regarding RGP:<br />
<br />
- So for the outdoors lighting in the game I will be using a procedural sky model originally presented in 2002 GDC by Naty Hoffman and Arcot J. Preetham. Implementation by <a href="http://www.simonwallner.at/">Simon Wallner</a> seemed to be the best one I could find and I have already got it working in BGE (see it <a href="http://blenderartists.org/forum/showthread.php?245954-preethams-sky-impementation-HDR">HERE</a>). I thought I was quite satisfied with the results, but just few days ago some guy asked for an assistance regarding the sky shader as he is implementing it in UDK4 engine. It turns out I had seen his works numerous times and visited his portfolio earlier, be sure to check it out <a href="http://www.davidmiranda.me/">HERE</a> <- awesome stuff! Anyways he also pointed out that it lacks the distinct sunrise feel to it so I took another look at the shader. After few modifications I came up with a nice sunset/sunrise effects. <br />
- I also added a Uncharted2 filmic tone mapping operator from John Hable's GDC presentation and implementation of it from <a href="http://filmicgames.com/archives/75">HERE</a>. I really Hope I can add a real HDR support in BGE someday.<br />
- Another feature I have been trying to replicate in BGE is generation of cubemap environment maps in real-time. I did it by simply rendering textures from 6 cameras and then combining them in a shader. It is slow but works! A simplified and optimized version of it I might use for reflection in the game.<br />
- And the last but not least - a pseudo lens flare by <a href="http://www.john-chapman.net/">John Chapman</a> (implementation from <a href="http://www.john-chapman.net/content.php?id=18">HERE</a>)<br />
<br />
blends:<br />
<br />
both files also feature point light scattering by <a href="http://blog.mmacklin.com/">Miles Macklin</a>.<br />
<br />
realtime cubemap:<br />
<a href="https://dl.dropbox.com/u/11542084/realtime_cubemap.blend">https://dl.dropbox.com/u/11542084/realtime_cubemap.blend</a><br />
<br />
lens flares:<br />
<a href="https://dl.dropbox.com/u/11542084/flare_playground_3.blend">https://dl.dropbox.com/u/11542084/flare_playground_3.blend</a><br />
<br />
screenshots:<br />
<br />
the upgraded sky model<br />
<br />
<a href="https://dl.dropbox.com/u/11542084/rgp_sunset.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/rgp_sunset.jpg" style="cursor: hand; cursor: pointer; height: 364px; width: 700px;" /></a><br />
<br />
real time cube environment mapping<br />
<br />
<a href="https://dl.dropbox.com/u/11542084/rgp_cubemap_0.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/rgp_cubemap_0.jpg" style="cursor: hand; cursor: pointer; height: 440px; width: 700px;" /></a><br />
<br />
<a href="https://dl.dropbox.com/u/11542084/rgp_cubemap_2.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/rgp_cubemap_2.jpg" style="cursor: hand; cursor: pointer; height: 444px; width: 700px;" /></a><br />
<br />
lens flares<br />
<br />
<a href="https://dl.dropbox.com/u/11542084/rgp_flare_0.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/rgp_flare_0.jpg" style="cursor: hand; cursor: pointer; height: 487px; width: 500px;" /></a><br />
<br />
<a href="https://dl.dropbox.com/u/11542084/rgp_flare_1.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/rgp_flare_1.jpg" style="cursor: hand; cursor: pointer; height: 486px; width: 500px;" /></a><br />
<br />
Battlefield3 style dusty lens<br />
<br />
<a href="https://dl.dropbox.com/u/11542084/rgp_flare_6.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/rgp_flare_6.jpg" style="cursor: hand; cursor: pointer; height: 500px; width: 500px;" /></a><br />
<br />
light directly into lens<br />
<br />
<a href="https://dl.dropbox.com/u/11542084/rgp_flare_2.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/rgp_flare_2.jpg" style="cursor: hand; cursor: pointer; height: 500px; width: 500px;" /></a><br />
<br />
<iframe width="700" height="390" src="http://www.youtube.com/embed/xyZWu23xpWA" frameborder="0" allowfullscreen></iframe>martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com25tag:blogger.com,1999:blog-5209117383455652131.post-89801343367931855062012-10-02T12:53:00.000-07:002012-10-03T08:10:29.513-07:00RGP day7so I've taken enough rest and today I am moving from "planning and preperation" to "sketching and concepting" phase of the development process.<br />
<br />
here is a fast 30 minute draft of shaping up the feel and scale of the desert planet. I will do a series of these.<br />
<br />
<a href="https://dl.dropbox.com/u/11542084/sk04.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/sk04.jpg" style="cursor: hand; cursor: pointer; height: 399px; width: 700px;" /></a><br />
<br />
<iframe allowfullscreen="allowfullscreen" frameborder="0" height="394" src="http://www.youtube.com/embed/NIiT6pFjgNM" width="700"></iframe><br />
<br />
Aside of the art part, today I tried <a href="http://mogurijin.wordpress.com/">Moguri</a>'s <a href="http://code.google.com/p/bgui/">BGUI</a>, which I will use for menu and some of in-game HUD. It looks very promising, but will require some intensive learning for me to get used to it. I am also planning to create a custom lighting engine with atmospheric scattering, aerial perspective, weather system, moon phases, etc. I will then build physics and handling mechanism on it. After I will publish first pre-alpha demo to try out.martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com6tag:blogger.com,1999:blog-5209117383455652131.post-86975728116645484432012-09-12T04:05:00.000-07:002012-09-12T04:05:04.073-07:00//status update 03 & RGP day 6it`s been a while, but no worries - the racing game project and BGE Candy is progressing. Slowly though as the spare time passes with friends and grasping the last summer days before I go back to France next week. After that aside from the job I am fully focusing again on RGP and BGE Candy.<br /><br /><b>RGP day 6</b><br /><br />After a few days of intensive tinkering with vector math, I finally found a perfect solution to get barycentric coordinates of the track (I explained about this coordinate concept in the <a href="http://devlog-martinsh.blogspot.fr/2012/07/day5-race-track-coordinate-concept.html">previous</a> post)<br /><br />
I found <i>rayCast() </i>function in Blender`s Python API which also fetches UV coordinates of the ray intersection point. So now all I need is to UV map the race track, shoot a ray from vehicle down to track`s vertical tangent and voila we get vehicles relative position on the track.<br /><br />I also made a simple racetrack trajectory recording system that records position and speed of the car at current segment. When it is recorded it saves it to a list and AI linearly interpolates between the points.<br /><br />
That`s it for now.
martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com9tag:blogger.com,1999:blog-5209117383455652131.post-15292302151559893862012-07-11T18:30:00.003-07:002012-07-20T03:48:59.724-07:00day5 - race track coordinate conceptYesterday I had some thoughts on the toughest challenges I will have to overcome during the development. I think it is wise to reckon them before I start the work on technical aspects of the game.<br />
Here is the first task that got me a little worried.<br />
<br />
<b>getting precise player positions in the race track space</b><br />
T<span style="background-color: white;">his includes for AI and player to know its exact distance from start and finish and distance from both track sides. I want to avoid any ray-checks from car to do that. It is too expensive and not very accurate. One solution is to have loads of colliders (sensors) covering the track, so whenever car touches one of the sensors we know how far the car is from sides and finish then it is possible to compare it with other cars and we know which car is leader and so on. But it is just not very efficient to manually add them for a hundred kilometers long track. </span><br />
<span style="background-color: white;">What I have in mind is to convert world space position to track-relative position. So it would switch from world xyz coordinates to track uv coords. U would correspond to travelled distance and range from 0.0 to 1.0 where 0.0 is start line and 1.0 is finish line (not sure about floating point precision here) and V would be track width ranging from -1.0 to 1.0 where 0.0 is middle of the track. This idea comes from <a href="http://blogs.msdn.com/b/shawnhar/archive/2009/12/30/motogp-ai-coordinate-systems.aspx">THIS</a> blog post about AI coordinate system used for MotoGP. I think it is very elegant and simplifies a lot of tasks especially AI behavior and keeping them on track without using bunch of waypoints and ray-check system.</span><br />
<span style="background-color: white;"><br />
</span><br />
<span style="background-color: white;">How would that work?<br />
</span><br />
<span style="background-color: white;">Vector power!</span><br />
<span style="background-color: white;">Race tracks will be made of segments which I will deform by curve and multiply with array till the end of the length of curve. </span><span style="background-color: white;">Lets assume that 1 track segment is a quadrilateral (tetragon) made of 4 points.</span><span style="background-color: white;"> To switch to track-realtive coordinates we need to know world position for each track segment. This means getting each point of track into an array and sort them to form lines, so each segments start & end line act as sort of check point. Then for each car we can get on which segment the car is on and calculate the fraction of the segment covered with point-quad or point-triangle intersection function.<br />
<br />I already got a chance to implement <a href="http://graphics.cs.kuleuven.be/publications/LD04ERQIT/LD04ERQIT.pdf">an efficient ray-quadrilateral intersection test</a> in BGE and it works really nicely, though I have to check performance compared to point-triangle intersection functions.<br /><br />
Here is a simple illustration:</span><br />
<br />
<a href="https://dl.dropbox.com/u/11542084/coo_concept.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/coo_concept.jpg" style="height: 604px; width: 700px;" /></a><br />
<br />
The tracks will have sharp turns, loops, banks, tilts and variety of configurations which makes the work on AI really hard, but converting all to track-relative coordinates "flattens" and "straightens" the track which makes work with AI ridiculously simple. <br />
some examples:<br />
<br />
<i>if (player.distance > otherplayer.distance):</i><br />
<i> #you are ahead of other player</i><br />
<br />
<i>difference = player.distance - otherplayer.distance</i><br />
<i>if (difference < treshold):</i><br />
<i> #start collision avoidance</i><br />
<i> #start the overtake process?</i><br />
<br />
how to check on which side to overtake an opponent:<br />
<br />
<i>if(overtake = 1):</i><br />
<i> #overtake in progress</i><br />
<i> player_ahead.width > 0.0 ? go_left : go_right</i><br />
<i> #see on which side is more space and go</i><br />
<i> #here we can also override previous statement to check if car width is wide enough to fit in the narrowest side and so on..</i><br />
<br />
this all is just a theory now how I imagine it to work in my game. I think many commercial racing games use similar approach and it works, but they have dedicated professional programmers up to the task. will see how I can handle this when I start the work. I am open for suggestions and perhaps there is even a better solution for this.<br />
<br />
Now I take a few day rest from the project as I am moving from France to Belgium and then back to Latvia.<br />
<br />
Edit:<br />I got working the basic concept of coordinate system:<br /><a href="https://dl.dropbox.com/u/11542084/get_track_position.blend">https://dl.dropbox.com/u/11542084/get_track_position.blend</a><br />
If this proves to be efficient enough for big tracks then I will use it in the game.<br />
<br />
<span style="font-size: x-small;">References:<br />1 - <a href="http://blogs.msdn.com/b/shawnhar/archive/2009/12/30/motogp-ai-coordinate-systems.aspx">http://blogs.msdn.com/b/shawnhar/archive/2009/12/30/motogp-ai-coordinate-systems.aspx</a></span><br />
<span style="font-size: x-small;">2 - <a href="http://answers.unity3d.com/questions/25189/race-position-help.html">http://answers.unity3d.com/questions/25189/race-position-help.html</a></span><br />
<span style="font-size: x-small;">3 - <a href="http://gamedev.stackexchange.com/questions/2382/how-would-one-determine-the-position-of-a-participant-in-a-racing-game">http://gamedev.stackexchange.com/questions/2382/how-would-one-determine-the-position-of-a-participant-in-a-racing-game</a></span><br />
<span style="font-size: x-small;">4 - <a href="http://graphics.cs.kuleuven.be/publications/LD04ERQIT/">http://graphics.cs.kuleuven.be/publications/LD04ERQIT/</a></span>martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com57tag:blogger.com,1999:blog-5209117383455652131.post-89331667538580410802012-07-07T16:54:00.000-07:002012-07-09T16:29:08.240-07:00water/undewater shader WIP<span style="color: #333333; font-family: Arial, Helvetica, sans-serif; line-height: 18px; text-align: left;">This is a water shader I am working on in my spare time. The work is based on my own observations of water characteristics and written from a scratch. It is still a work in progress.</span><br />
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif;"><span style="color: #333333; line-height: 18px; text-align: left;">Right now the water surface is a plane, but support for real geometry waves is on its way.</span></span><br />
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif;"><br style="color: #333333; line-height: 18px; text-align: left;" /></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white;"><span style="color: #333333; line-height: 18px; text-align: left;">Due to my old computer I am currently on, I am almost unable to capture a video with decent framerate, but the shader uses simple calculations and runs very well on even 6 years old mid-end hardware.</span></span><span style="background-color: #fafafa;"><span style="background-color: white;"><span style="color: #333333; text-align: left;"><br /></span></span></span></span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="background-color: #fafafa; font-family: Arial, Helvetica, sans-serif;"> <span style="color: #333333;"><iframe allowfullscreen="" frameborder="0" height="480" src="http://www.youtube.com/embed/zkdBGe8tfNw" width="640"></iframe></span></span><br />
<span style="background-color: #fafafa; font-family: Arial, Helvetica, sans-serif;"></span><br />
<span style="background-color: #fafafa;"><span style="background-color: white;"><span style="color: #333333; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;"><br />
</span></span></span></span><br />
<span style="background-color: #fafafa;"><span style="background-color: white;"><span style="color: #333333; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;">thread on BlenderArtists <a href="http://blenderartists.org/forum/showthread.php?242940-unlimited-planar-reflections-amp-refraction-(update)">HERE</a></span></span></span></span><br />
<span style="background-color: #fafafa;"><span style="background-color: white;"><span style="color: #333333; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;"><br /></span></span></span></span><br />
<span style="background-color: #fafafa;"><span style="background-color: white;"><span style="color: #333333; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;">blend <a href="https://dl.dropbox.com/u/11542084/water_0.95_packed.blend">HERE</a></span></span></span></span><br />
<span style="background-color: #fafafa;"><span style="background-color: white;"><span style="color: #333333; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></span></span><br />
<span style="background-color: #fafafa;"><span style="background-color: white;"><span style="color: #333333; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif;">known issues and bugs:</span></span></span></span><br />
<span style="background-color: #fafafa;"><span style="background-color: white;"><span style="color: #333333; font-family: Arial, Helvetica, sans-serif; text-align: left;">- OpenGL clipping plane is not working on some GPUs</span></span></span><br />
<span style="background-color: #fafafa;"><span style="background-color: white;"><span style="color: #333333; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif;">- mouselook goes wacko on some BLender versions but works fine in others</span></span></span></span><br />
<span style="background-color: #fafafa;"><span style="background-color: white;"><span style="color: #333333; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif;">- some are reporting that sun-grab is not working</span></span></span></span><br />
<span style="background-color: #fafafa;"><span style="background-color: white;"><span style="color: #333333; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif;">- and for some it does not open blend at all..</span></span></span></span>martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com21tag:blogger.com,1999:blog-5209117383455652131.post-88858880519051454172012-07-04T17:28:00.000-07:002012-10-16T12:37:53.576-07:00RGP GDD (work in progress)As I mentioned before I will post all of the development process online. Today I am making a <a href="http://en.wikipedia.org/wiki/Game_design_document">game design document</a> or GDD. This is the first time I am writing one on my own.<br />
I consider GDD to be one the of most important parts of the game development process, especially if there are more than 1 developer working on the project. Well in my case this document will be a lead that will keep me on track and I do not waste time on details while there is not a solid foundation yet.<br />
<br />
<i>all content here is a subject to change and will form up in further development of the game. At one point I will have to make a document file. For now this is more like a verbal sketchbook of ideas and concepts not a proper GDD, so here it goes..</i><br />
<br />
----------------------------------------------------------------------------<span style="background-color: white;">----------------------------------------------------------------------------</span><br />
<h3>
<span style="font-size: large;">"Racing Game Project¹"</span></h3>
<span style="font-size: x-small;">¹I will come up with a proper title in the process</span><br />
<br />
<br />
<b>BRIEF OVERVIEW</b><br />
<br />
RGP is a fast paced single player¹ racing game where the player is a pilot of ultra fast, hovering race vehicles². Game setting takes place in a distant future or a fictional parallel universe on various distinct planets around the galaxies. The aim of the race is to test the very limits of racers skills, endurance and cutting-edge technology of vehicles in various terrain and weather conditions, much like <a href="http://en.wikipedia.org/wiki/Rallying">Rally Racing</a> and <a href="http://en.wikipedia.org/wiki/Formula_One">Formula One</a>.<br />
<br />
<span style="font-size: x-small;">¹ multiplayer not planned for now</span><br />
<span style="font-size: x-small;">² will need a name of the vehicle</span><br />
<span style="font-size: x-small;"><br />
</span><br />
<b>STORY</b><br />
<br />
Player takes a role of a race car driver born on a fictional desert planet¹ where except for racing there is not much else to do. Player has to prove that he is the best racer on the planet in order to qualify for much more prestige races taking place in different locations. Here starts player's journey through galaxies and exotic places and extreme races. As player progresses through the game the vehicles get faster and more responsive, racetracks more dangerous and more challenging.<br />
<br />
<span style="font-size: x-small;">¹planet not yet named</span><br />
<span style="font-size: x-small;">Edit: darn this sounds like a plot from StarWars Ep1 taking place on Tatooine...</span><br />
<br />
<br />
<b>GAMEPLAY</b><br />
<br />
Well racing games is all about being first to the finish line.<br />
The goal of my game is for player to experience the racing itself and have fun, rather than finishing <span style="background-color: white;">the race always</span><span style="background-color: white;"> first, and this might not be that easy. To do this I might make different vehicle classes or groups separated by their performance. For example p</span><span style="background-color: white;">layer starts with a lower class race car and competes against better race cars. To qualify further, player needs just finish the race, or </span><span style="background-color: white;">during the race player competes in different race groups. Player does not have to finish first, but finishing at higher position in your race group is the aim. Overtaking higher class cars might make finish more rewarding. Well of course eventually the final cup becomes a fight for the first place.</span><br />
<span style="background-color: white;"><br />But, while the game is in the development, I will focus on primary goals - having great race mechanics and make a challenging opponents.</span><br />
<br />
<br />
<b>RACE CARS</b><br />
<br />
Player has a control over a jet engine powered racing vehicles able to reach speeds that exceeds the speed of sound ( <span style="font-family: inherit;">in dry air -> <span style="background-color: white; line-height: 19px;">1236 kph / 768 mph</span></span><span style="background-color: white;">). Vehicles are specially designed to be agile and race at extremely high speeds. The overall design is to be aggressive yet sleek, something between jet fighter and Formula-1, the design is very distinct for each class or manufacturer. Cockpit is completely isolated from outside world as races often take place at poisonous atmospheres, very low atmosphere densities or even vacuum. Race cars are powered by a fictional power source fit in a compact capacitors that can be filled up instantaneously by being near the power source. It also powers the power-ups and onboard weapon system¹.</span><br />
<span style="background-color: white;"><br /></span>
<span style="font-size: x-small;">¹ I am not yet sure if I want add a weapons system in the game.</span><br />
<br />
<span style="background-color: white;"><b>RACE TRACKS</b><br />
<br />
As races take place in different planets the tracks vary in every possible way -</span><span style="background-color: white;"> </span><span style="background-color: white;">track</span><span style="background-color: white;"> length & width, terrain, weather, hazards, even day/night cycle, etc. As the vehicles are hovering there is no need for a dedicated race track so it can take place at canyons, forests, deserts, rough surfaces and hills and even above water. Off-road racing is much more extreme and adds additional difficulty unlike on specialized racing tracks (from now on called "speedways"). Speedways offer a completely different racing experience - it is more narrow and requires more precision while overtaking and planning turns. </span><br />
<br />
Length of each racetrack might be around few hundred kilometers. Most of the tracks will be cyclic, but alternate routes will add variation in each lap. Alternate routes are an important part of a race track design. Some of them might be harder to reach, but more rewarding to use, some would shorten the track if used properly, but add risk losing speed otherwise. As I mentioned there are off-road races and speedways. Speedways<span style="background-color: white;"> are powered with a force field that keeps race cars on the track. This allows speedways to be oriented at any angle, and keeps vehicles racing even upside down. When off-road, racers have full freedom. Off road races takes place at canyons, dry lakes, oceans, hills and snow filled landscapes. The only lead that shows you that you are on the course are checkpoint marks, it is up to you how you reach them.</span><br />
<span style="background-color: white;"><br />
</span><br />
<span style="background-color: white;"><b>GAME MECHANICS</b></span><br />
<span style="background-color: white;"><br />
</span><br />
<span style="background-color: white;">I plan to keep the controls as intuitive and simple as possible, so it has a steep or almost non existent learning curve even for newcomers in the racing genre. The difficulty of game will increase as the player progresses in the story. I want to completely get rid of manual difficulty settings in game options.</span><br />
<span style="background-color: white;"><br /></span>
<span style="background-color: white;">I am putting high priority on the vehicle physics. Making a race game for cars without wheels makes the task much easier, but getting the right feel and believability might be a difficult task. The ground friction is non existent (as the vehicle does not have contact with ground) I get to play around more with air friction and physics laws behind it. This involves changes in vehicle control at higher speeds, changes of pressure at different atmosphere densities or behind other vehicles.</span><br />
<span style="background-color: white;">Visual feedback as <a href="http://en.wikipedia.org/wiki/Vapor_cone">vapor cone</a> at high speeds and humid environments will add more realism in physics presence.</span><br />
<br />
<br />
<b>PRESENTATION</b><br />
<br />
Having a memorable and unique visual style is one of the most important tasks in the development process.<br />
As I have graduated in fine arts, I feel that visual aspect of the work is one of my strongest sides. I am planing to keep the game in somewhat retro futurism style, like seen in 60s - 70s futurist artworks - smooth, bright, shiny and simple, but in the same time functional and realistic.<br />As a professional shader designer I will focus on creating the game visually stunning and physically plausible using atmospheric effects, smooth lighting, volumetric clouds, smoke and fog, dynamic FX and sophisticated post-processing. As the hardcoded lighting engine in BGE is currently quite limited, I will make a completely custom lighting, shading and effects engine, written from ground up completely in GLSL.<br />(to be continued)<br />
<br />
<b>REALIZATION</b><br />
<br />
I am making my game in Blender Game Engine (BGE). I am a long time BGE user and I know what it is capable of as well as its limits.<br />
<br />
<span style="background-color: white;">This is how I plan to split the realization process.</span><br />
<br />
- planning & preparation<br />
- sketching &<span style="background-color: white;"> </span><span style="background-color: white;">concepting</span><br />
- developing game core mechanics<br />
- developing graphics and shaders<br />
- developing game art<br />
- developing sound, graphics & effects<br />
- putting all together<br />
- playable alpha version<br />
- debugging<br />
<br />
<b>planning and preparation</b><br />
Is stuff I am doing here right now - collecting my ideas and putting them on paper. Gathering inspiration - watching videos, images, reading books. Drawing sort of an initial roadmap for the development. Having a good rest before sketching and concepting. Taking a rest nicely fit in this schedule as I am moving back from France to Latvia.<br />
<br />
<b>sketching &<span style="background-color: white;"> </span><span style="background-color: white;">concepting</span></b><br />
Taking a look at collected ideas, t<span style="background-color: white;">hen getting rid of complex and stupid ideas and keeping simple and good ones.<br />Making sketches and concept art of environments, vehicles, characters, menu, HUD, overall style, etc.</span><br />
Alternately "sketching" the game code, making code snippets and proof of concepts. Visualizing it on paper how all pipeline interacts with idea to have easily upgradeable system. Creating a simple test vehicle. <span style="background-color: white;">Making of a playground for testing gameplay, car handling and physics, tracks, controls etc.</span><br />
Making of first track sketches with placeholders. Testing it over and over again till it plays right.<br />
<br />
<b>developing game core mechanics</b><br />
Taking the "sketched" game code and clean, polish, and make it solid till basic gameplay works and I have something to build further features on.<br />
<br />
<b>developing game art</b><br />
Here starts track building from track sketches, car making from concept art, texture painting, menu creation, prop modeling, etc.<br />
<br />
<b>developing graphics, sound & effects</b><br />
Making of unified shading system as I plan to have every material for the game to be completely hand written. Making particle effects. Recording, mixing, and making of sound effects<br />
<br />
<b>putting it all together</b><br />
as fun this sounds, it is actually a long process of separating directories, optimizing models (LoD), linking them to scenes, optimizing scenes, adding collision meshes, optimizing shaders. Then comes lighting, adding effects and testing & tweaking till it looks and plays right.<br />
<br />
<b>playable alpha version</b><br />
fun part for everyone, game-testing, collecting bugs and stuff.<br />
<br />
<b>debugging</b><br />
ensuring that bugs does not distract game experience.<br />
<br />
<br />
<b>INSPIRATION</b><br />
<b><br />
</b>Here is the list of games and artists which I consider my mentors for this project:<br />
<br />
1. <a href="http://en.wikipedia.org/wiki/Wipeout_(video_game)">Wipeout series</a> <span style="background-color: white;">from developer </span><a href="http://en.wikipedia.org/wiki/Psygnosis" style="background-color: white;">Psygnosis</a> <span style="background-color: white;">is </span><span style="background-color: white;">first title everyone mentions when seeing concept art</span><span style="background-color: white;">. I am a big fan of <a href="http://en.wikipedia.org/wiki/Wipeout_2097">Wipeout 2097</a> (1996, 2002 Mac), which I used to play on my old Mac a lot.</span><br />
<span style="background-color: white;">2. <a href="http://www.sparth.com/">Sparth</a> (Nicolas Bouvier) is my </span><span style="background-color: white;">favorite concept artist since I started game-dev as an artist in 2006. The atmosphere and feel in his works is the main inspiration for environments of my game.</span><br />
<span style="background-color: white;">3. <a href="http://en.wikipedia.org/wiki/Star_Wars_Episode_I:_Racer">Star Wars Episode I: Racer</a> by <a href="http://en.wikipedia.org/wiki/LucasArts">LucasArts</a> (1999), awesome game. Love the race tracks, feel of speed, sound design, etc.</span><br />
<span style="background-color: white;">4. <a href="http://sydmead.com/">Syd Mead</a> does not need an introduction :) or does it? he is awesome!</span><br />
<span style="background-color: white;">5. <a href="http://en.wikipedia.org/wiki/DethKarz">DethKarz</a> by </span><span style="background-color: white;"><a href="http://en.wikipedia.org/wiki/Melbourne_House">Melbourne House</a> (1998) </span><span style="background-color: white;">- an underrated futuristic racing game with beautiful visuals for the time. basically Wipeout + wheels.</span><br />
6. <a href="http://www.johnliberto.com/">John Wallin Liberto</a><br />
7. <a href="http://en.wikipedia.org/wiki/XG3:_Extreme_G_Racing">Extreme G Racing series</a> from <a href="http://en.wikipedia.org/wiki/Acclaim_Cheltenham">Acclaim</a> - <a href="http://en.wikipedia.org/wiki/Extreme-G_2">Extreme G2 (XG2)</a> (1998) finally a game where you can break the sound barrier and it is actually shown and heard<br />
8. <a href="http://vyle-art.com/">Vyle</a> (David Levy)<br />
9. <a href="http://en.wikipedia.org/wiki/F-Zero">F-ZERO series</a><br />
10. <a href="http://www.goodbrush.com/">Goodbrush</a> (Craig Mullins)<br />
<br />
----------------------------------------------------------------------------<span style="background-color: white;">----------------------------------------------------------------------------</span><br />
<br />
<b>day3:</b><br />
just posted first version of GDD. It is awesome how much things get clear while writing a game design document. I did not put even half of my initial ideas, so that is the work for tomorrow. I feel that much of the game will form up while writing more in-depth description for each of the planets, cars and the technical details.<br />
<br />
<b>day4:</b><br />
updated some stuff. I had a 3 day holidays, but I am back now. I got prematurely a little worried about technical stuff like getting precise relative position of each race-car on the track. But I consider this as a healthy challenge and extra experience in vector math.<br />
<br />
<b>day8:</b><br />
added stuff in "<span style="font-size: x-small;">PRESENTATION"</span>martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com5tag:blogger.com,1999:blog-5209117383455652131.post-85697222723917883602012-07-03T11:30:00.000-07:002012-07-04T17:41:09.998-07:00RGP day2After a free screen-cast application roundup for Mac, I came to a conclusion that VLC is by far the best one. Still on this old and slow Mac I found it hard to work in Photoshop while screencasting even at 1fps.<br />
<br />
So here is a vehicle concept:<br />
<br />
<a href="https://dl.dropbox.com/u/11542084/sk6f.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/sk6f.jpg" style="cursor: hand; cursor: pointer; height: 546px; width: 700px;" /></a><br />
<br />
<iframe allowfullscreen="" frameborder="0" height="438" src="http://www.youtube.com/embed/FywtL3GokzE" width="700"></iframe><br />
<br />
This is done as an exercise and test before I start my work on the game for real. Mostly to test out sketching workflow and screen-casting.<br />
<br />
<br />
I have not thought of the title of the game yet, but for now I will call it "RGP" - Racing Game Project<br />
<br />
Next up - game details and putting all my thoughts and ideas on a paper (in this case - blog)martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com1tag:blogger.com,1999:blog-5209117383455652131.post-34780221856177840802012-07-02T09:42:00.001-07:002012-07-04T04:00:42.300-07:00a new game projectwhile working on "BGE Candy" I realized I need a game I can apply the new features on. The idea of the game has been brewing for a while in my head now and I feel it is mature enough to start developing it further. I have not been sketching for few years already, so my hand needs some training..<br />
Here are three first drawings, you can guess the genre from these already :)<br />
<br />
(took me few hours each)<br />
<br />
<a href="https://dl.dropbox.com/u/11542084/sk1.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/sk1.jpg" style="cursor: hand; cursor: pointer; height: 293px; width: 700px;" /></a><br />
<br />
<a href="https://dl.dropbox.com/u/11542084/sk2.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/sk2.jpg" style="cursor: hand; cursor: pointer; height: 291px; width: 700px;" /></a><br />
<br />
<a href="https://dl.dropbox.com/u/11542084/sk3.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/sk3.jpg" style="cursor: hand; cursor: pointer; height: 656px; width: 350px;" /></a><br />
<br />
I will try to keep the visual style of the game as clean as possible using mostly gradients, nuanced lighting, atmospheric effects, vertical shapes and simple geometry.<br />
The art of <a href="http://www.sydmead.com/">Syd Mead</a>, <a href="http://www.sparth.com/">Sparth</a> (Nicolas Bouvier), <a href="http://www.sebastienlarroude.com/">Rainart</a> (Sebastien Larroude), <a href="http://vyle-art.com/">Vyle</a> (David Levy), <a href="http://www.johnliberto.com/">John Wallin Liberto</a> and other awesome concept artists will keep me inspired :)<br />
<br />
I have already done BGE version of <a href="http://www.simonwallner.at/">Simon Wallner's</a> sky implementation originally from 2002 GDC Presentation by Naty Hoffman and Arcot J. Preetham. <a href="http://blenderartists.org/forum/showthread.php?245954-preethams-sky-impementation-HDR">HERE</a> is the link to implementation details and even a demo. It will take care of lighting and atmospheric effects:<br />
<br />
<a href="https://dl.dropbox.com/u/11542084/sky2.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/sky2.jpg" style="cursor: hand; cursor: pointer; height: 361px; width: 700px;" /></a><br />
<br />
<a href="https://dl.dropbox.com/u/11542084/sky3.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/sky3.jpg" style="cursor: hand; cursor: pointer; height: 361px; width: 700px;" /></a><br />
<br />
..maybe I can finally finish a game I have started<br />
I will screen cast the whole developing process from now on.martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com13tag:blogger.com,1999:blog-5209117383455652131.post-75314377616528063372012-06-29T09:36:00.000-07:002012-06-29T09:36:47.229-07:007DFPS<a href="http://7dfps.org/">7DFPS</a> - yeah I participated as a weapon and character 3D modeler in a group of skilled BlenderArtists. Although we did not finish the game in time, our project is still going on. I started late, I think in day 3. Here is some stuff I did for it:<br />
<br />
SigSauer P226 (coincidentally the same gun team <a href="http://www.wolfire.com/">Wolfire</a> made for their 7DFPS <a href="http://www.wolfire.com/receiver">Receiver</a>)<br />
2570 tris<br />
1024x1024 diffuse/spec maps<br />
<br />
<a href="https://dl.dropbox.com/u/11542084/sigready_1.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/sigready_1.jpg" style="cursor: hand; cursor: pointer; height: 439px; width: 600px;" /></a><br />
<br />
<a href="https://dl.dropbox.com/u/11542084/sigready_2.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/sigready_2.jpg" style="cursor: hand; cursor: pointer; height: 443px; width: 600px;" /></a><br />
<br />
<a href="https://dl.dropbox.com/u/11542084/sigready_3.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/sigready_3.jpg" style="cursor: hand; cursor: pointer; height: 505px; width: 600px;" /></a><br />
<br />
wire (red edges - UV seams)<br />
<br />
<a href="https://dl.dropbox.com/u/11542084/sigwire.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/sigwire.jpg" style="cursor: hand; cursor: pointer; height: 395px; width: 600px;" /></a><br />
<br />
team "swat" character w/o helmet<br />
2720 tris<br />
1024x1204 diffuse/spec maps<br />
<br />
unlit<br />
<br />
<a href="https://dl.dropbox.com/u/11542084/newswat.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/newswat.jpg" style="cursor: hand; cursor: pointer; height: 367px; width: 600px;" /></a><br />
<br />
<br />
<a href="https://dl.dropbox.com/u/11542084/swatwire.jpg"><img alt="" border="0" src="https://dl.dropbox.com/u/11542084/swatwire.jpg" style="cursor: hand; cursor: pointer; height: 477px; width: 600px;" /></a><br />
<br />
there is also an op-force character, but he is not yet done.martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com0tag:blogger.com,1999:blog-5209117383455652131.post-9307115721425488632012-05-08T07:24:00.001-07:002012-05-10T09:21:57.438-07:00projected grid in vertex shaderI am in the middle of making a <a href="http://blenderartists.org/forum/showthread.php?242940-unlimited-planar-reflections-amp-refraction-(update)">complete water/underwater shading system</a> in GLSL. Water surface wave displacement is now the last thing to deal with and "projected grid" concept is something I wanted to try. You can read about it in this cool article <a href="http://habib.wikidot.com/projected-grid-ocean-shader-full-html-version">HERE</a>. But one thing I did not found is an approach to do it completely in a vertex shader, which might speed and simplify things a lot.<br />
<br />
As an exercise I reinvented one myself.<br />
<br />
What it does is scales the our grid to view frustum space coordinates and projects it to specified plane in the world.<br />
The easy thing is that frustum-space (untransformed) coordinates for our water plane is already provided as gl_Vertex. The value range is between -1.0 to 1.0 and values outside of this range correspond to points which are not in viewing frustum.<br />
So in X axis -1.0 is left and 1.0 is right edge of the screen, Y - upper and lower edge, but for Z -1.0 is <i>near</i> plane and 1.0 is <i>far</i> plane. The tricky part is that while X and Y values are linear, Z values are exponential - more densely packed at <i>near</i> plane.<br />
Next part is to create a virtual plane to project our grid to. We only need the grid Z axis to be projected as X and Y are already at needed position - at screen edges. To do so, we need to create world position. I transformed texture coordinates of grid with camera transformation matrices and then with <a href="http://en.wikipedia.org/wiki/Line-plane_intersection">line-plane intersection</a> I got the coordinates of ground plane. And finally we create a depth from ground position to apply to Z coordinate of the grid. As Z is exponential, I found <a href="http://en.wikipedia.org/wiki/Z-buffering">THIS</a> very useful to convert linear depth to exponential.<br />
<br />
screenshots (not an eye candy yet):<br />
<br />
wire:<br />
<a href="http://dl.dropbox.com/u/11542084/projgrid_01.jpg"><img alt="" border="0" src="http://dl.dropbox.com/u/11542084/projgrid_01.jpg" style="cursor: hand; cursor: pointer; height: 450px; width: 600px;" /></a><br />
<br />
filled:<br />
<a href="http://dl.dropbox.com/u/11542084/projgrid_02.jpg"><img alt="" border="0" src="http://dl.dropbox.com/u/11542084/projgrid_02.jpg" style="cursor: hand; cursor: pointer; height: 450px; width: 600px;" /></a><br />
<br />
clamped size:<br />
<a href="http://dl.dropbox.com/u/11542084/projgrid_03.jpg"><img alt="" border="0" src="http://dl.dropbox.com/u/11542084/projgrid_03.jpg" style="cursor: hand; cursor: pointer; height: 450px; width: 600px;" /></a><br />
<br />
with a displacement map:<br />
<a href="http://dl.dropbox.com/u/11542084/projgrid_04.jpg"><img alt="" border="0" src="http://dl.dropbox.com/u/11542084/projgrid_04.jpg" style="cursor: hand; cursor: pointer; height: 450px; width: 600px;" /></a><br />
<br />
<br />
There is yet a lot of work ahead, but I felt I should share this. Maybe someone finds this useful.<br />
<br />
get the vertex shader <a href="http://dl.dropbox.com/u/11542084/projected_grid_vert.glsl">HERE</a><br />
<br />
edit: I found a technique by <a href="http://www-evasion.imag.fr/Membres/Eric.Bruneton/">Eric Bruneton</a>, which is much more useful easier and faster than mine, hehe. Still it was a nice exercise and I found out bunch of new stuff while doing this.<br />
<br />martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com1tag:blogger.com,1999:blog-5209117383455652131.post-50222482890831305742012-04-06T09:08:00.000-07:002012-04-06T09:08:52.585-07:00BGE Candy status update 01It has been a busy week with real life stuff, so I am not progressing very fast.<br />
<br />Last 2 days I have been working on environment reflection mapping coordinates. Blender currently have only view-space reflection coords <i>reflect(viewvec,viewnormal);</i> and of course that is not nearly enough for a proper IBL (Image Based Lighting) setup.<br />
<br />
So first I implemented world space reflection coordinates so the environment texture is world oriented.<br />
Then I have implemented 2 most widely used mapping algorithms - "Angular" or "Sphere" mapping and "Equirectangular" or "Spherical Panorama" mapping but sometimes also called "Blinn/Newell Latitude-Longitude" mapping.<br />The third and most widely used one - "Cube mapping" should be already possible as a built-in function in OpenGL, but I have to figure out how to make it work in BGE.<br />
<br />
Same mapping techniques can be applied not only on "Reflection" coordinates, but also on "Object" and "Normal" coordinates, which means that besides doing reflection and specular reflection, the environment mapping can also be used for texturing the object or doing image-based diffuse lighting.<br />
<div class="separator" style="clear: both; text-align: -webkit-auto;">
<br /></div>
these are the 3 environment map textures:<br />
<br />
"sphere" or "angular" map<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.pauldebevec.com/Probes/uffizi_probe.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://www.pauldebevec.com/Probes/uffizi_probe.jpg" /></a></div>
<br />
"equirectangular" or "spherical panorama" or "Blinn/Newell latitude-longitude" map<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.scratchapixel.com/assets/Uploads/Reflection%20Mapping/rm-probeexample-latlong.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="160" src="http://www.scratchapixel.com/assets/Uploads/Reflection%20Mapping/rm-probeexample-latlong.png" width="320" /></a></div>
<br />
"cube" map<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://dl.dropbox.com/u/11542084/envmap_cube_uffizi.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="213" src="http://dl.dropbox.com/u/11542084/envmap_cube_uffizi.png" width="320" /></a></div>
<br />
All 3 of them does the same job, but with different results. I found a nice article about all three of env-map approaches explained in detail <a href="http://www.reindelsoftware.com/Documents/Mapping/Mapping.html">HERE</a><br />
<br />
I'm going to vacation for 2 weeks, so no BGE Candies till then..martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com3tag:blogger.com,1999:blog-5209117383455652131.post-28973409232313819332012-03-22T10:04:00.002-07:002012-03-23T02:25:18.860-07:00BGE Candy branchFrom now on I am a part of Blender developers team. Together with <a href="http://diexon.com/portfolio/">Matthew Dietel</a> aka <a href="http://blenderartists.org/forum/member.php?44973-mokazon">mokazon</a> we started a new Blender development branch called "BGE Candy" with main goal to fix broken and add missing and new (mostly visual) features to Blender Game Engine.<br />
<br />
I am quite excited about this, I even made our own logo and splash screen (with "sweet", "eye", "candy" and "Blender" in mind)<br />
<br />
<a href="http://dl.dropbox.com/u/11542084/candy_splash.jpg"><img alt="" border="0" src="http://dl.dropbox.com/u/11542084/candy_splash.jpg" style="cursor: hand; cursor: pointer; height: 600px; width: 600px;" /></a><br />
<br />
so here is the list of stuff currently done and yet to be done.<br />
<br />
done:<br />
• SSS (subsurface scattering) material<br />
• rectangular area lights<br />
• logic connector highlighting in UI<br />
<br />
in progress:<br />
• parallax mapping<br />
• volumetric point & spot lights<br />
• real-time composite nodes<br />
<br />
planned: <br />
• volumetric shadowing for volumetric lights<br />
• environment cube-mapping<br />
• scrolling texture coordinates in Blender material editor<br />
• timer node in material node editor<br />
• world normals in material node editor<br />
• extra uniform inputs for 2D GLSL filters<br />
• extra 2D GLSL filters<br />
• Sky and Atmosphere<br />
• fog volumes<br />
<br />
BGE Candy branch thread in BlenderArtists <a href="http://blenderartists.org/forum/showthread.php?248538-New-BGE-Features">HERE</a>martinshhttp://www.blogger.com/profile/12279637301695841134noreply@blogger.com8