<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1096533244660546051</id><updated>2011-12-29T00:35:43.339-08:00</updated><title type='text'>Oren Game Engine</title><subtitle type='html'>After few months seeing far-cry/doom3-quake4/fear i decided to create my own game engine, so this blog will show my progress</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default?start-index=101&amp;max-results=100'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>103</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-6533285571198086513</id><published>2011-12-28T23:56:00.000-08:00</published><updated>2011-12-29T00:35:43.346-08:00</updated><title type='text'>Playing Inside Artist World...</title><content type='html'>hi&lt;br /&gt;recently i put my time mainly in modeling/texturing etc... so in  the post i will talk about the tools and the pipeline i'm using and then  i'll show some works i'm working on.&lt;br /&gt;the tools i'm using is:&lt;br /&gt;1.  autodesk 3dsmax 2012, 3d modeling software, for me its the best  software... i always liked this program, very easy to understand and  control, tons of tutorials more stable version.&lt;br /&gt;2. autodesk mudbox  2012, this is a new program i had to learn from scratch, basically its a  3d sculpting and painting app, allows you to create high detail models  and paint directly on them.&lt;br /&gt;3. adobe photoshop, nothing to say about it, great image editing software.&lt;br /&gt;so, the pipeline i'm using now is:&lt;br /&gt;1. collect reference pictures, anything i want in my scene i search for real world references from different viewing angles.&lt;br /&gt;2.  start modeling low poly model using the reference images i collected,  yes yes, i know i should start modeling high poly model and then create  the low poly one, but i found this technique is a waste of time (for  most of the models), and i can add detail later in mudbox/photoshop and  believe me you wont even know...&lt;br /&gt;3. create uv mapping, well, this is  really important, what we really want is to create a uv set the maximize  texture space in a way that important parts of the model get bigger  area in the texture and at the same time try to make all our uv  islands/chinks uniform as much as possible, in simple words, if you put a  checker board texture on the model, you should see uniform checkers.&lt;br /&gt;4. texturing, for this i'm using both photoshop and mudbox:&lt;br /&gt;mudbox  used when i don't need pixel perfect alignment and its great as i can  see the results immediately, photoshop used when i need to fix things  and add extra detail that needs pixel perfect matching...&lt;br /&gt;&lt;br /&gt;one of  the best things in 3dsmax/mudbox/photoshop is that they communicate, in a  single click i can send model to mudbox, paint on it, another click to  pass the textures to photoshop, fix few things and return to mudbox,  the textures in modbox update automatically, and then in another click i update max scene to contain all the changes... really cool stuff, and time  saver!&lt;br /&gt;&lt;br /&gt;another thing that is really cool is that autodesk software can be downloaded for free! yes free!&lt;br /&gt;how,  well, they have an education program that allow students to enjoy their  software, so what you really need to do is to register, fill your  education info etc.. and you can download everything for free! really  nice...&lt;br /&gt;on autodesk site, click solutions-education-students-join...&lt;br /&gt;&lt;br /&gt;the  pipeline described used to create diffuse texture, to create other   textures: normal/bump, specular etc... you can also use mudbox and   photoshop also, though you can use other app's like: crazybump,  shadermap  pro, ndo2 etc... great programs.&lt;br /&gt;maybe i will post on this next time.&lt;br /&gt;&lt;br /&gt;now for some works i did recently (simple scene lighting, mudbox capture, without normal/bump/specular maps)&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-VIifiW4_0uA/Tvwkv9B4n8I/AAAAAAAAAkU/Zmme0z6WE8E/s1600/fusebox.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 304px;" src="http://2.bp.blogspot.com/-VIifiW4_0uA/Tvwkv9B4n8I/AAAAAAAAAkU/Zmme0z6WE8E/s400/fusebox.jpg" alt="" id="BLOGGER_PHOTO_ID_5691464435344383938" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Fuse Box&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-7b-4KxDNPsY/Tvwkvcda2fI/AAAAAAAAAkI/8ZeqbzCZHmY/s1600/trailertire.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 304px;" src="http://2.bp.blogspot.com/-7b-4KxDNPsY/Tvwkvcda2fI/AAAAAAAAAkI/8ZeqbzCZHmY/s400/trailertire.jpg" alt="" id="BLOGGER_PHOTO_ID_5691464426601503218" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Trailer Tire&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-AwcilLQXCWw/TvwkvPOJ7bI/AAAAAAAAAj4/NYlxKb_Jeoc/s1600/woodpallet.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 304px;" src="http://4.bp.blogspot.com/-AwcilLQXCWw/TvwkvPOJ7bI/AAAAAAAAAj4/NYlxKb_Jeoc/s400/woodpallet.jpg" alt="" id="BLOGGER_PHOTO_ID_5691464423047818674" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Wood Pallet&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-pkgdhnCPkF0/Tvwku_BrJdI/AAAAAAAAAjw/T596AyftBeo/s1600/barrel.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 304px;" src="http://1.bp.blogspot.com/-pkgdhnCPkF0/Tvwku_BrJdI/AAAAAAAAAjw/T596AyftBeo/s400/barrel.jpg" alt="" id="BLOGGER_PHOTO_ID_5691464418700502482" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Barrel&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-xw-9A5eca3c/TvwkwMde1-I/AAAAAAAAAkg/cn0G9B-AYqA/s1600/powerbox.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 304px;" src="http://1.bp.blogspot.com/-xw-9A5eca3c/TvwkwMde1-I/AAAAAAAAAkg/cn0G9B-AYqA/s400/powerbox.jpg" alt="" id="BLOGGER_PHOTO_ID_5691464439486666722" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Power Box&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;cya until next time...&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-6533285571198086513?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/6533285571198086513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=6533285571198086513' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6533285571198086513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6533285571198086513'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2011/12/playing-inside-artist-world.html' title='Playing Inside Artist World...'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-VIifiW4_0uA/Tvwkv9B4n8I/AAAAAAAAAkU/Zmme0z6WE8E/s72-c/fusebox.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-4832398350657324968</id><published>2011-11-28T04:03:00.000-08:00</published><updated>2011-11-28T04:42:01.314-08:00</updated><title type='text'>FBX Exporter</title><content type='html'>Hi&lt;br /&gt;after the last post, i had to create a new plan and the first phase was to support different app's to create assets from.&lt;br /&gt;&lt;br /&gt;up until now, i use my own maya exporter, which converts models/animations to my own format the engine can read.&lt;br /&gt;this exporter was created entirely for the artist as he worked with maya.&lt;br /&gt;&lt;br /&gt;for the record, i don't know to work with maya, but i know to work with 3dsmax, at the time, i didn't want to handle models/animation and prefer to focus on dev but now i will need to do both.&lt;br /&gt;&lt;br /&gt;anyway, i decided that an FBX exporter will be good since i know to model/animate with max so i could create few things here and there and in the future i will not bound to a single software, and this is great as finding artist will be much easier if you are not bound to single app.&lt;br /&gt;&lt;br /&gt;for these who don't know FBX format: FBX is an autodesk format created so you could share works with different autodesk app's like maya, 3dsmax, softimage, motionbuilder, mudbox etc...&lt;br /&gt;FBX it comes will full SDK &amp;amp; samples and have fairly readable doc that explain how to use and build FBX app. (can be downloaded from autodesk site)&lt;br /&gt;&lt;br /&gt;because i already had maya exporter which had all the conversion code to the engine, i just needed to import the fbx and convert everything just like i did with the old exporter, and within few hours i had support for models (no animation).&lt;br /&gt;&lt;br /&gt;to support animation i had to dig a little bit as at first i tried to convert the matrices imported from the FBX to engine format at import time (left handed Z up) and that didn't went very well, as the hierarchy of the skeleton needed to work with the stored format, even when i succeeded the animation was screw up.&lt;br /&gt;so what i did i imported the data as is (not changing/converting anything) and only in the exporting phase (just before writing to a file) i convert to my own engine format.&lt;br /&gt;just like i did in the old maya exporter...&lt;br /&gt;i burn a lot of hours just to realize that what i did in the old maya exporter was correct, if i just went and look at the old code i could save a lot of time and thinking...&lt;br /&gt;&lt;br /&gt;after i finishing this i notice few animation didn't running correctly, some vertices isn't moving like they supposed to (relative the the skeleton), and after digging a little more i saw that some code i took from the old exporter wasn't fit right for the new one, and the vertices indices wasn't correct.&lt;br /&gt;'vertices indices' means i have for each vertex X indices or more, for vertex position,normal,uv etc.. so these was screw up (the order wasn't correct) and the nasty thing is that for few test models with animation there was no bug at all and for some there was.&lt;br /&gt;&lt;br /&gt;NOTE: the skeleton always act and looks fine but vertices wasn't, so it was hard to track down the bug.&lt;br /&gt;the way i eventually track it is that i created a very simple model with animation and compare each of the vertices weights with the vertices weights exported (using weight table in 3dsmax), when i did that i notice that the weights values was fine but the order wasn't, so few vertices that influence by bone1 was influence by bone2 etc...&lt;br /&gt;&lt;br /&gt;anyway, one thing to remember from this is that when you take code from some old code of yours make sure to check it fits, and don't assume its good.&lt;br /&gt;it can be good/clean code but it doesn't means it fits like a glove...&lt;br /&gt;&lt;br /&gt;so now that the pipeline works you will see some works on the next posts...&lt;br /&gt;cya&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-4832398350657324968?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/4832398350657324968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=4832398350657324968' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4832398350657324968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4832398350657324968'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2011/11/fbx-exporter.html' title='FBX Exporter'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-8272072997736543839</id><published>2011-10-19T11:24:00.000-07:00</published><updated>2011-10-19T12:52:36.087-07:00</updated><title type='text'>The Smell of the Money Can Make You Blind...</title><content type='html'>Hi all&lt;br /&gt;this time i'v some "bad" news.&lt;br /&gt;last post i wrote about a project i'm about to expose, unfortunately this isn't going to happened.&lt;br /&gt;i turns out that when "my friend" saw we have some real thing in our hands he smell the money, and that make him do what he did this week.&lt;br /&gt;i wont get into details (numbers and stuff), but i feel i need to share what went wrong so if you will be in my position you know what to do.&lt;br /&gt;&lt;br /&gt;i got to know this guy from a good friend of mine, so i trust my friend that this guy is ok.&lt;br /&gt;from day one our working model based on free time only!&lt;br /&gt;i gave him X percent for starting, and he began to work on some models, after working for a while, i rise it 1.5X and eventually he got 2X percent, even that the work he did stays the same, average of one model per week! (for the simple ones!, complex ones could get to one month)&lt;br /&gt;&lt;br /&gt;2 weeks before exposing he told me that he wants more and told me to think very careful about what i'm going to say, so i though and even that there was no good reason to rise it up, i want him to be happy, so i give him another 25% of the 2X he got and told him i want him to sign on a contract i will arrange about everything we agreed on.&lt;br /&gt;&lt;br /&gt;this week he told me that he doesn't want to continue, talking a little bit with him i realize that he wants 25%+, and he told me that i can't use his models in anyway... for the record, i can use them for non profit use, but i decided that i don't want to, i don't want him to have anything with my projects not now and not ever...&lt;br /&gt;&lt;br /&gt;after checking out what he actually did in almost 2 years i saw its less than 50 models! including the simplest one (cans, bottles, barrels etc), so giving him 25% is giving him 0.5% per model!&lt;br /&gt;&lt;br /&gt;so the bottom line of all this little story is:&lt;br /&gt;don't trust anyone when doing this kind of thing, make a construct from day one, i did one and gave him but i didn't insist him to sign it, bad mistake.&lt;br /&gt;i will be happy to hear what do you think, did i do the right thing? did i handled it correctly?&lt;br /&gt;&lt;br /&gt;i always knew that money can blind wise peoples, but now i know that even the smell...&lt;br /&gt;&lt;br /&gt;i will continue to update this blog, hopefully more recent...&lt;br /&gt;cya&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-8272072997736543839?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/8272072997736543839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=8272072997736543839' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8272072997736543839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8272072997736543839'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2011/10/smell-of-money-can-make-you-blind.html' title='The Smell of the Money Can Make You Blind...'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-8385655389726345087</id><published>2011-10-06T01:43:00.000-07:00</published><updated>2011-10-06T02:44:04.050-07:00</updated><title type='text'>Stay Tuned for the BLAST!</title><content type='html'>hi&lt;br /&gt;recently i'm not updating this blog often, the reason is that me and my friend working very hard on a big project and i can't find time to post, every free minute i have i put in the project...&lt;br /&gt;if you are curious, here are some Q/A:&lt;br /&gt;&lt;br /&gt;* so... whats the big project you are working on?&lt;br /&gt;well, basically it's a game.&lt;br /&gt;&lt;br /&gt;* what kind of game?&lt;br /&gt;that's will be published soon.&lt;br /&gt;&lt;br /&gt;* what is so special about this game?&lt;br /&gt;feeling! we work hard to make it feel real, in terms of look and feel...&lt;br /&gt;&lt;br /&gt;* is it going to be a full game?&lt;br /&gt;no, for now we will publish one level, to show what we can do.&lt;br /&gt;&lt;br /&gt;* what engine are you using?&lt;br /&gt;internal, for now i named it: OGE (oren game engine)&lt;br /&gt;&lt;br /&gt;* why didn't you use cry-engine,unreal, unity,ogre, or any other free engines out there?&lt;br /&gt;one word: freedom!&lt;br /&gt;&lt;br /&gt;* can you tell about the engine a little?&lt;br /&gt;yes, but this can be a very long answer, so here are few cool things we have:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; Editor - the engine is just loading and running levels, all logic and  gameplay scripted or set by the editor (nothing is hard coded)&lt;/li&gt;&lt;li&gt; Graphics - real-time GI, HDR, filmic tonemapping and filmic DOF , sun  effects, flares unlimited lights and shadows! (every light cast shadow)  and more...&lt;/li&gt;&lt;li&gt; UI - script based dynamic UI system supporting any resolution.&lt;/li&gt;&lt;/ul&gt; * where can i see screenshots, videos?&lt;br /&gt;soon i will post screenshots of the project, and talked about few nice things i'v added into.&lt;br /&gt;&lt;br /&gt;* do you need people to join in?&lt;br /&gt;yep, basically we need:&lt;br /&gt;art guys - concept, models, textures, animations etc...&lt;br /&gt;sound/music guys to do sound effects and music.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;so if you know someone, feel free to contact me.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;i'v you have questions you want to ask, feel free...&lt;br /&gt;cya&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-8385655389726345087?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/8385655389726345087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=8385655389726345087' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8385655389726345087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8385655389726345087'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2011/10/stay-tuned-for-blast.html' title='Stay Tuned for the BLAST!'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-8833274696476272072</id><published>2011-08-15T01:10:00.001-07:00</published><updated>2011-08-15T02:14:50.089-07:00</updated><title type='text'>Sun Lens Flare</title><content type='html'>&lt;br /&gt;&lt;br /&gt;hi&lt;br /&gt;this time i added sun lens flare effect, if you don't know what i'm talking about, just read about it here&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Lens_flare"&gt;http://en.wikipedia.org/wiki/Lens_flare&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;or if you are lazy :) here is a picture shown this effect:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-OcSJkOtKqJA/TkjXJlziZII/AAAAAAAAAjY/SXZjZe1ovPg/s1600/flare785.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 290px;" src="http://3.bp.blogspot.com/-OcSJkOtKqJA/TkjXJlziZII/AAAAAAAAAjY/SXZjZe1ovPg/s400/flare785.jpg" alt="" id="BLOGGER_PHOTO_ID_5640995093048616066" border="0" /&gt;&lt;/a&gt;anyway, to create this effect, what you really need is few things:&lt;br /&gt;1. couple of flare images&lt;br /&gt;2. light position in 2d (screen space)&lt;br /&gt;&lt;br /&gt;1. this is simple, just google on it, and you'll get some nice textures... (you can also use photoshop)&lt;br /&gt;2. take you sun light position and project it into screen space, check z to make sure the light isn't behind the camera.&lt;br /&gt;after you have this 2d pos, you need to create 2d direction vector pointed to the center of the screen, and place the flares from 1 in a different color/sizes along this vector.&lt;br /&gt;that's it.&lt;br /&gt;one thing to note is that flares do not disappear immediately when occluded, they basically stay visible and fade away very nice and smoothly (also when they become visible), thats because these flares created from a very bright light sources.&lt;br /&gt;to achieve this kind of effect, what we really need is a way to count how much the light is occluded.&lt;br /&gt;from this info we can compute a scale factor between [0..1] and scale the lens color so they fade in and out smoothy.&lt;br /&gt;few options to use:&lt;br /&gt;&lt;br /&gt;1. the simplest and naive way is to trace few rays from the light to camera eye and see how many of them passed and then compute scale factor from 0..1&lt;br /&gt;pros: simple to implement.&lt;br /&gt;cons: not accurate, can hurt performance.&lt;br /&gt;&lt;br /&gt;2. texture masking, you render the scene from light point of view to small render target, lets say 16x16 (cleared to white), for every pixel passed you write black, at the end this texture will tell you how much the sun is occluded (the black pixels), to get the result from it, you can lock it out and count for the black/white pixels - not good idea, a better way is to render this texture into 1x1 render target (float point rt, and we will have to use 16x16 vertices for each pixel), we need to enable alpha blending to count the pixels. note that 1 in the 16x16 rt, could be counter for 256 times if all the texture is white (sun isn't occluded), but we need a value between 0..1 to scale the lens color with, so what we output from the ps, is the sampled pixel from the 16x16 rt scaled by 1.0/256.0 (16x16 = 256)&lt;br /&gt;pros: better accuracy.&lt;br /&gt;cons: not easy to implement, need hw float point rt, can hurt performace for big scenes.&lt;br /&gt;&lt;br /&gt;3. use hardware occlusion query, just rendered some simple query mesh (quad,box,sphere) and count how many pixels passed, from this you can compute scale factor between 0..1&lt;br /&gt;note that its a little tricky to use, you need a way to know the maximum pixels for the query mesh so you could compute the [0..1] scale factor, second, they can hurt your performance if isn't used right.&lt;br /&gt;pros: very accurate, performance is very good if done right.&lt;br /&gt;cons: need hw occlusion query support, can be tricky to do right.&lt;br /&gt;&lt;br /&gt;here is a scren shot to show you the effect in action:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-9xB4gfgTBJg/Tkji6bRA_xI/AAAAAAAAAjo/E2v7YFITIV8/s1600/LensFlare0.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://4.bp.blogspot.com/-9xB4gfgTBJg/Tkji6bRA_xI/AAAAAAAAAjo/E2v7YFITIV8/s400/LensFlare0.jpg" alt="" id="BLOGGER_PHOTO_ID_5641008026660962066" border="0" /&gt;&lt;/a&gt;no lens effect&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-YQNf1VmkkvA/Tkji6RvdsUI/AAAAAAAAAjg/95tXJFZj_ME/s1600/LensFlare1.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://1.bp.blogspot.com/-YQNf1VmkkvA/Tkji6RvdsUI/AAAAAAAAAjg/95tXJFZj_ME/s400/LensFlare1.jpg" alt="" id="BLOGGER_PHOTO_ID_5641008024104317250" border="0" /&gt;&lt;/a&gt;with lens effect&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;in my implementation i use option 3...&lt;br /&gt;that's it for now, cya until next time ;)&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-8833274696476272072?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/8833274696476272072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=8833274696476272072' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8833274696476272072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8833274696476272072'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2011/08/sun-lens-flare.html' title='Sun Lens Flare'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-OcSJkOtKqJA/TkjXJlziZII/AAAAAAAAAjY/SXZjZe1ovPg/s72-c/flare785.jpg' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-7494476672974629987</id><published>2011-06-12T09:40:00.000-07:00</published><updated>2011-06-18T13:16:33.196-07:00</updated><title type='text'>Sun Shafts / God Rays</title><content type='html'>hi&lt;br /&gt;&lt;br /&gt;this time i talk about nice effect called: sun shafts/god rays/sun rays...&lt;br /&gt;to save words explaining what it is, i found a nice picture that shows how this effects looks like in reality:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-H6PmsgnGPoI/TfTtO9e_rZI/AAAAAAAAAjA/CW4InVwYP0U/s1600/fall-forest-with-sun-rays-through-the-trees-thumb8388519.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://1.bp.blogspot.com/-H6PmsgnGPoI/TfTtO9e_rZI/AAAAAAAAAjA/CW4InVwYP0U/s400/fall-forest-with-sun-rays-through-the-trees-thumb8388519.jpg" alt="" id="BLOGGER_PHOTO_ID_5617375476516367762" border="0" /&gt;&lt;/a&gt;notice how the sun "enters" between the trees and block by others, this create the light shafts you see in the picture.&lt;br /&gt;so how do we going to do this effect in real-time you ask?&lt;br /&gt;well,  very simple, good old demo scene effect called radial blur as post  process effect will do the work (well, with a little help of some Gaussian blur)&lt;br /&gt;so the main steps is:&lt;br /&gt;1. compute light position in screen space (this is our sun light pos)&lt;br /&gt;2. compute radial blur on our image, this is done by blurring the image using normalized pixel to light direction.&lt;br /&gt;something like this:&lt;br /&gt;&lt;br /&gt;blur_dir = (sun_pos_2d - pixel_pos) / NUM_SAMPLES&lt;br /&gt;sum = 0&lt;br /&gt;for i = 0 to NUM_SAMPLES do&lt;br /&gt;{&lt;br /&gt;sum += sample(image, uv)&lt;br /&gt;uv += blur_dir&lt;br /&gt;}&lt;br /&gt;return sum / NUM_SAMPLES&lt;br /&gt;&lt;br /&gt;this  is just an example of the radial blur idea, keep in mind that in order to  make the effect looks good you need to weight the samples to give you  the best look that you are looking for.&lt;br /&gt;3. combine both sun shafts result we got in 2, with our original image.&lt;br /&gt;thats it.&lt;br /&gt;here is some pictures to show the effect in action:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-MGWfclxkKDA/TfTv_ojeIdI/AAAAAAAAAjI/9e3dPYq7u4A/s1600/SunShafts_0.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://3.bp.blogspot.com/-MGWfclxkKDA/TfTv_ojeIdI/AAAAAAAAAjI/9e3dPYq7u4A/s400/SunShafts_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5617378511734841810" border="0" /&gt;&lt;/a&gt;no sun shafts&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-R8WdYZ3bZ4g/TfTv_96V8tI/AAAAAAAAAjQ/3RB75BUqPL4/s1600/SunShafts_1.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://3.bp.blogspot.com/-R8WdYZ3bZ4g/TfTv_96V8tI/AAAAAAAAAjQ/3RB75BUqPL4/s400/SunShafts_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5617378517467919058" border="0" /&gt;&lt;/a&gt;with sun shafts&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;if you follow exactly by the steps i wrote, you probably need a lot of samples to get nice results, so here is few tips to make the effect fast and smooth:&lt;br /&gt;1. try to down sample your image and apply the sun shafts effect on it&lt;br /&gt;2. blur the sun shafts result with your favorite blur (should be fast enough)&lt;br /&gt;3. because it a post effect, the effect will apply the sun shafts on all the image resulting shafts from none sun light pixels, to overcome this, you should mask out all pixels that shouldn't be effected by the sun shafts effect, techniques to consider:&lt;br /&gt;* stencil buffer&lt;br /&gt;* depth buffer&lt;br /&gt;whatever fits you engine...&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;that's it for now, if you have any question, feel free to ask...&lt;br /&gt;cya until next time&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-7494476672974629987?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/7494476672974629987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=7494476672974629987' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7494476672974629987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7494476672974629987'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2011/06/sun-shafts-god-rays.html' title='Sun Shafts / God Rays'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-H6PmsgnGPoI/TfTtO9e_rZI/AAAAAAAAAjA/CW4InVwYP0U/s72-c/fall-forest-with-sun-rays-through-the-trees-thumb8388519.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-8562420152598450419</id><published>2011-05-03T05:22:00.000-07:00</published><updated>2011-05-03T06:09:09.561-07:00</updated><title type='text'>Bitwise Operators on Low End GPU's</title><content type='html'>hi&lt;br /&gt;recently i was needed to perform bitwise operators on SM 3, but as you know, SM 3- doesn't support it (only DX10 SM 4.0 and up).&lt;br /&gt;if you try to write this line: (hlsl SM 3 for example):&lt;br /&gt;some_var &amp;amp; 2&lt;br /&gt;you will get error message saying: Bitwise operations not supported on legacy targets.&lt;br /&gt;the technique i present here can be used for few more things (lighting, shading etc), but here i will show how to do bitwise ops with it.&lt;br /&gt;i support: &amp;amp;, |, ^ (AND,OR,XOR) - more complicated operators could be used but these are the base.&lt;br /&gt;the trick is to use a texture to store the results of these operators, and then to sample this texture and get the result.&lt;br /&gt;a code to compute this texture will look like this: (assuming 8 bit range for AND op)&lt;br /&gt;for i=0 to 255&lt;br /&gt;for j=0 to 255&lt;br /&gt;texture[i][j] = i &amp;amp; j&lt;br /&gt;to maximize storage, encode different operators on different channels.&lt;br /&gt;here is a sample texture that encode AND,OR,XOR in different channels:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/--7RKg060TaU/Tb_7DNs4BlI/AAAAAAAAAi0/VMuCu8Vcg4M/s1600/bitwiseop.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 256px; height: 256px;" src="http://2.bp.blogspot.com/--7RKg060TaU/Tb_7DNs4BlI/AAAAAAAAAi0/VMuCu8Vcg4M/s400/bitwiseop.jpg" alt="" id="BLOGGER_PHOTO_ID_5602472494108247634" border="0" /&gt;&lt;/a&gt;bitwise operators texture: AND,OR,XOR&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;the way you use this texture in your shader looks something like this: (hlsl style)&lt;br /&gt;float AND(in float A, in float B)&lt;br /&gt;{&lt;br /&gt;tex2Dlod(BitwiseOpMap, float4(A, B,0,0)).r;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;NOTE: make sure you use POINT sampling, you don't want to filter the results in the texture, you also don't need mipmaps...&lt;br /&gt;&lt;br /&gt;thats it, i hope you find this post useful...&lt;br /&gt;cya until next time ;)&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-8562420152598450419?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/8562420152598450419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=8562420152598450419' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8562420152598450419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8562420152598450419'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2011/05/bitwise-operators-on-low-end-gpus.html' title='Bitwise Operators on Low End GPU&apos;s'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/--7RKg060TaU/Tb_7DNs4BlI/AAAAAAAAAi0/VMuCu8Vcg4M/s72-c/bitwiseop.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-7847382390965650382</id><published>2011-05-01T10:04:00.000-07:00</published><updated>2011-05-01T11:20:19.801-07:00</updated><title type='text'>Post Anti-Aliasing #2</title><content type='html'>hi&lt;br /&gt;few months ago i'v read an article on intel research group called:  Morphological Antialiasing.&lt;br /&gt;this technique designed for cpu but with few  tricks and hacks we can use it on gpu as well.&lt;br /&gt;the algorithm consist of 3 main steps:&lt;br /&gt;1. find discontinuities between pixels&lt;br /&gt;2. identify predefined patterns&lt;br /&gt;3. blend pixels in the neighborhood of the patterns in 2&lt;br /&gt;1.   simple edge detection on the image, using depth or color differences   should do the work, keep in mind that you should encode edge type in you   color channels so you could use it in 2, lets say red is horizontal   edges, and g is vertical edges.&lt;br /&gt;2. this is tricky, you basically need to identify few shapes: Z, U, L&lt;br /&gt;see image below (grabbed from original intel article):&lt;br /&gt;&lt;img src="file:///C:/Users/ORENK/AppData/Local/Temp/moz-screenshot-5.png" alt="" /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-D-ZpEPzDqgg/Tb2V4eyHV7I/AAAAAAAAAh8/oJRD9KaQwtY/s1600/MLAAShapes.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 251px;" src="http://4.bp.blogspot.com/-D-ZpEPzDqgg/Tb2V4eyHV7I/AAAAAAAAAh8/oJRD9KaQwtY/s400/MLAAShapes.jpg" alt="" id="BLOGGER_PHOTO_ID_5601798309087238066" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Reshetov A. 2009. Morphological Antialiasing. In &lt;em&gt;Proceedings of High Performace Graphics&lt;/em&gt;&lt;/div&gt;&lt;br /&gt;so based on the article, you only need to identify L shapes, as Z, U can be split into L shapes.&lt;br /&gt;for more deep information please refer to the original article that can be found here:&lt;br /&gt;&lt;a href="http://visual-computing.intel-research.net/publications/publications.htm#Y2009"&gt;http://visual-computing.intel-research.net/publications/publications.htm#Y2009&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;to   identify L shapes there are few tricks, a simple one is to just follow   the edges you mark in 1 and see if you get a match (few loops for each side: left/right/top/bottom and of course  branching),  if so you compute blend weights for these and continue to  the next  edges.&lt;br /&gt;at the end, you end up with blend weights texture so  you could  blend the pixel to get the final image, you can use a the  trick  described in gpu pro 2, they encode the final weights in textures and  sample  it.&lt;br /&gt;btw: if you have ATI HD 6850+ you have built in support  for that,  so no need to worry, for consoles you may want to worry a  little ;)&lt;br /&gt;&lt;br /&gt;this  technique isn't simple to implement as a first  shot, i tried few  algorithms and techniques before i got this thing  working.&lt;br /&gt;after seeing the demo from gpu pro 2, i'v got to say i was  impressed by the speed of  their implementation so i put some tricks  into mine as well to get the  missing cycles :)&lt;br /&gt;&lt;br /&gt;optimization tip: when doing edge detection pass, use the stencil buffer to mark these pixels, then in the next step, use the stencil apply your "massive" shapes/blend weights shader only on edges pixels, this way you won't waste power on irrelevant pixels&lt;br /&gt;&lt;br /&gt;here is a few screenshots of the main steps and result:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-d5TSjw7ssq0/Tb2ehT2H6gI/AAAAAAAAAiE/Si3HOJkYJ2E/s1600/Edges.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/-d5TSjw7ssq0/Tb2ehT2H6gI/AAAAAAAAAiE/Si3HOJkYJ2E/s400/Edges.png" alt="" id="BLOGGER_PHOTO_ID_5601807806618921474" border="0" /&gt;&lt;/a&gt;Edges Detection with encoded edge type using image colors&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-0doGVL3nZTk/Tb2ehlDnKsI/AAAAAAAAAiM/uk3BqqTZdVY/s1600/Weights.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/-0doGVL3nZTk/Tb2ehlDnKsI/AAAAAAAAAiM/uk3BqqTZdVY/s400/Weights.png" alt="" id="BLOGGER_PHOTO_ID_5601807811238898370" border="0" /&gt;&lt;/a&gt;Blend Weights&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-PCNi6SMpbCU/Tb2eiF3RyrI/AAAAAAAAAiU/M0mktv3guOo/s1600/NoMLAA.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/-PCNi6SMpbCU/Tb2eiF3RyrI/AAAAAAAAAiU/M0mktv3guOo/s400/NoMLAA.png" alt="" id="BLOGGER_PHOTO_ID_5601807820045535922" border="0" /&gt;&lt;/a&gt;Without MLAA&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-uMBr41vseHk/Tb2eim0Ym6I/AAAAAAAAAic/yxZuDqADVXY/s1600/WithMLAA.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/-uMBr41vseHk/Tb2eim0Ym6I/AAAAAAAAAic/yxZuDqADVXY/s400/WithMLAA.png" alt="" id="BLOGGER_PHOTO_ID_5601807828891769762" border="0" /&gt;&lt;/a&gt;With MLAA&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-eN8qoXDHk-E/Tb2fcPZUiUI/AAAAAAAAAis/dlZbW26lx8I/s1600/ZoomNoMLAA.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 256px; height: 256px;" src="http://4.bp.blogspot.com/-eN8qoXDHk-E/Tb2fcPZUiUI/AAAAAAAAAis/dlZbW26lx8I/s400/ZoomNoMLAA.png" alt="" id="BLOGGER_PHOTO_ID_5601808819036653890" border="0" /&gt;&lt;/a&gt;Without MLAA&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-pYBFuIsyt1o/Tb2fb6QlcDI/AAAAAAAAAik/PnW4QwjBkuI/s1600/ZoomWithMLAA.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 256px; height: 256px;" src="http://4.bp.blogspot.com/-pYBFuIsyt1o/Tb2fb6QlcDI/AAAAAAAAAik/PnW4QwjBkuI/s400/ZoomWithMLAA.png" alt="" id="BLOGGER_PHOTO_ID_5601808813362868274" border="0" /&gt;&lt;/a&gt;With MLAA&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;as you can see, this technique have very good result.&lt;br /&gt;extra: few other techniques you should check:&lt;br /&gt;* GPAA - show it at humus&lt;br /&gt;* FXAA - nvidia sdk 11 (looks pretty good)&lt;br /&gt;&lt;br /&gt;cya until next time...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-7847382390965650382?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/7847382390965650382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=7847382390965650382' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7847382390965650382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7847382390965650382'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2011/05/post-anti-aliasing-2.html' title='Post Anti-Aliasing #2'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-D-ZpEPzDqgg/Tb2V4eyHV7I/AAAAAAAAAh8/oJRD9KaQwtY/s72-c/MLAAShapes.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-1033460486341930285</id><published>2011-03-20T11:31:00.000-07:00</published><updated>2011-03-20T12:07:39.642-07:00</updated><title type='text'>Adding Vegetation</title><content type='html'>hi&lt;br /&gt;one of the thing i always wanted to add is vegetation, tree, weeds, grass etc...&lt;br /&gt;in a nutshell, to support all kind of vegetation you need to have few things:&lt;br /&gt;1. some app to generate the content, plant model, textures etc.&lt;br /&gt;2. engine supporting geometry instancing.&lt;br /&gt;3. extra (depends of scene size), engine supporting model level of detail (LOD)&lt;br /&gt;4. extra (depends of scene size), engine supporting good outdoor culling.&lt;br /&gt;1.  this is very critical, having great app for generating plants is a  must, if the model and textures isn't quality enough, the best code  won't do much... i checked some apps, and i want to tell you that if you  have some $, speedtree is the way to go, checked it, love it...&lt;br /&gt;2. if  you are going to render plants, you won't render one tree with  1x1 meter of grass, you probably want to spread it all over a 1x1 km  terrain, so you are going to render hundreds of the same plant with  different properties or such, so you don't want to kill your gpu with  20000 draw calls... unless real time performance isn't an issue for you. &lt;br /&gt;for me performance is critical so i'v implemented instancing support for  each plant type.&lt;br /&gt;3. if your scene is large enough you need to  consider LOD support, there is not need to render full plant geometry  from certain distance, you probably won't notice if its real geometry or  simple billboard, but your gpu will, so consider replacing you full  model with low model or even quad when distance to eye pos is large  enough.&lt;br /&gt;i added auto lod support in the engine and use it also for  plants (maybe i will post on it next time)&lt;br /&gt;4. if your scene is large enough and you have massive amount of plants, so you already know that its a good idea to cull your data.&lt;br /&gt;&lt;br /&gt;anther thing, because we are using instancing on the same model again and again, its a better idea to break      symmetry when rendering the plants.&lt;br /&gt;you can place them with  different rotation and apply random motion for each plant (in shader).&lt;br /&gt;here is a screenshot of a test scene:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-YOh3nKhqX_Q/TYZOpD-m4NI/AAAAAAAAAh0/dJPGNeNM5ZA/s1600/Vegetation.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/-YOh3nKhqX_Q/TYZOpD-m4NI/AAAAAAAAAh0/dJPGNeNM5ZA/s400/Vegetation.jpg" alt="" id="BLOGGER_PHOTO_ID_5586238855149183186" border="0" /&gt;&lt;/a&gt;vegetation, sun shafts and dynamic atmosphere&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;cya until next time...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-1033460486341930285?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/1033460486341930285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=1033460486341930285' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/1033460486341930285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/1033460486341930285'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2011/03/adding-vegetation.html' title='Adding Vegetation'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-YOh3nKhqX_Q/TYZOpD-m4NI/AAAAAAAAAh0/dJPGNeNM5ZA/s72-c/Vegetation.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-8419576311639997155</id><published>2011-01-30T03:56:00.000-08:00</published><updated>2011-01-30T05:22:17.523-08:00</updated><title type='text'>Lens Effect / Bokeh - Getting Into Details</title><content type='html'>hi&lt;br /&gt;last time i talked about lens effect/bokeh, this time i talk about how to do it using FFT with information of how to implement it on the GPU.&lt;br /&gt;i will not get into the theory of FFT, if you want to, check out this:&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Fast_Fourier_transform"&gt;http://en.wikipedia.org/wiki/Fast_Fourier_transform&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;what i will explain here is how to do image processing using FFT and how to achieve a lens effects/bokeh filter.&lt;br /&gt;if we have an image and we apply FFT on it we get this image in something called frequency domain.&lt;br /&gt;after applying FFT every pixel in the image have its own frequency in the frequency domain that compose of a real and imaginary parts (a complex number)&lt;br /&gt;after getting the image in the frequency domain, all we have to do is to decide which frequencies we want to "filter" out and then, apply the inverse FFT to get back to our image domain again, without the "filtered pixels"&lt;br /&gt;that's the main idea.&lt;br /&gt;&lt;br /&gt;nice thing with FFT is that its separable, what this means is that to apply FFT in 2D, we can simply apply 2 1D FFT, the first one goes on the rows (horizontal) and the second one goes on the columns (vertical) of the result.&lt;br /&gt;another thing to know is that transforming N points can be done with two N/2 transforms, that is a dived and conquer approach, which helps to reuse computations.&lt;br /&gt;so knowing that, we will use a divide and conquer algorithm called butterflies:&lt;br /&gt;more info can be found here:&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Butterfly_diagram"&gt;http://en.wikipedia.org/wiki/Butterfly_diagram&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.cmlab.csie.ntu.edu.tw/cml/dsp/training/coding/transform/fft.html"&gt;http://www.cmlab.csie.ntu.edu.tw/cml/dsp/training/coding/transform/fft.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;you can see really nice diagrams which helps to understand how it is  works and how we can create and encode indices and weights for doing FFT  on the GPU using textures and ping/pong method.&lt;br /&gt;&lt;br /&gt;so if for example we have N=8 points to transform, we have log2(8) =3 steps of butterflies to perform, beginning with computation on four 2 points DFT, then two 4 points DFT and finally one 8 points DFT.&lt;br /&gt;&lt;br /&gt;so, assuming you understand what the butterfly does, the steps to do it on the GPU is a matter of doing those steps:&lt;br /&gt;1. create 2 textures (render targets) used for the ping/pong operations, those needed to be with high precision float point because the pixel on the frequency domain is a complex number with greater range than the pixel in the image spatial domain.&lt;br /&gt;2. encode indices &amp;amp; weights into texture (also high precision)&lt;br /&gt;3. do log2(Width) horizontal butterflies steps (using RT's from 1 and bf from 2)&lt;br /&gt;4. do log2(Height) vertical butterflies steps (using RT's from 1 and bf from 2) on the result from 3&lt;br /&gt;lets call those steps GPFFT&lt;br /&gt;note: the log2 in steps 3,4 - this needs your image to with power of two size.&lt;br /&gt;so how all of this nasty things helps us to do image processing on an image? and where is the bokeh stuff?&lt;br /&gt;so here is the beauty:&lt;br /&gt;suppose we have 2 images, one of them is our kernal, lets call it K, and the other is our source image that we wish to apply the effect on, lets call it I&lt;br /&gt;apply GPFFT on K,I (transform them into frequency domain),  multiply them together (complex multiply, remember we are using complex number in this domain), and then apply inverse GPFFT (to inverse transform the result) on the result to get a new I' convolved with K.&lt;br /&gt;and that's it, all it matter is how your K looks like (the size and shape: triangle, square, octagon etc) and whats I.&lt;br /&gt;as for bokeh/lens effect, basically it is working on bright pixels so simply filter the brighter pixels from your image with some threshold into other image (this is your I) and do the process on it.&lt;br /&gt;this method works on low systems, DX9 with MRT support.&lt;br /&gt;we can optimize the algorithm a lot using DX11 compute shader and get rid of the log(N) passes of steps 3,4 and perform only on pass each.&lt;br /&gt;hope this post didn't make you headache' i'm starting to get one ;P&lt;br /&gt;that's it for now&lt;br /&gt;cya next time...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-8419576311639997155?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/8419576311639997155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=8419576311639997155' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8419576311639997155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8419576311639997155'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2011/01/lens-effect-bokeh-getting-into-details.html' title='Lens Effect / Bokeh - Getting Into Details'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-7004136512421134982</id><published>2011-01-04T13:56:00.000-08:00</published><updated>2011-01-04T15:01:08.321-08:00</updated><title type='text'>Lens Effect / Bokeh</title><content type='html'>hi&lt;br /&gt;this time i'm attacking a problem related to lens blur effect or bokeh.&lt;br /&gt;as you know (or don't) real time app such as games mimic lens effects with blur filters that applied on some image (scaled or not, depending or the app)&lt;br /&gt;until   now, blur could be done with few methods/filters such as gaussian,   poisson disk, bilateral and etc depending on the problem you want to   solve.&lt;br /&gt;for example:&lt;br /&gt;1. Gaussian could be used for blurring image that need a smooth look, like lighting and such...&lt;br /&gt;2. Poisson disk blur could be used to smooth shadow mapping as it faster than 1 and basically produces nice result.&lt;br /&gt;3. Bilateral blur could be for smoothing SSAO, because it can take into   account few vars (like normal, depth) when doing the blur and reduce   bleeding.&lt;br /&gt;ok, those methods used until now and rely on   samples count.&lt;br /&gt;more samples means nicer result but takes a lot of   power and most of the time it doesn't really worth it...&lt;br /&gt;what we   really need is a filter that doesn't rely on the kernal/filter size and   mimic real camera lens effects without killing our app and can achieve this:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_GKvgMH3qkR0/TSOeoZVFVoI/AAAAAAAAAhM/TxJWTUumbTM/s1600/Josefina_with_Bokeh.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 267px;" src="http://4.bp.blogspot.com/_GKvgMH3qkR0/TSOeoZVFVoI/AAAAAAAAAhM/TxJWTUumbTM/s400/Josefina_with_Bokeh.jpg" alt="" id="BLOGGER_PHOTO_ID_5558460781936596610" border="0" /&gt;&lt;/a&gt;image taken from wiki under 'bokeh'&lt;br /&gt;Coarse bokeh on a photo shot with an 85mm lens and 70mm aperture, which corresponds to f/1.2&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;the circle shapes is what we need to achieve! (or any other shape we want).&lt;br /&gt;how  we get this in reality: when we use smaller f in our camera, out of  focus areas/points blurred into polygonal shape formed by the aperture  blades.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;somebody did this in real time or what? yes, Futuremark group in their new 3dmark 2011 benchmark (the underwater demo... amazing stuff...) and i think me 8p&lt;br /&gt;lets see screenshots:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_GKvgMH3qkR0/TSOhq0sCFUI/AAAAAAAAAhk/K-lHgUk5_Rs/s1600/Bokeh_0.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 400px;" src="http://3.bp.blogspot.com/_GKvgMH3qkR0/TSOhq0sCFUI/AAAAAAAAAhk/K-lHgUk5_Rs/s400/Bokeh_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5558464122175231298" border="0" /&gt;&lt;/a&gt;original image&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_GKvgMH3qkR0/TSOhq3ZtaEI/AAAAAAAAAhc/EcU5Hdg-i8c/s1600/Bokeh_1.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 400px;" src="http://2.bp.blogspot.com/_GKvgMH3qkR0/TSOhq3ZtaEI/AAAAAAAAAhc/EcU5Hdg-i8c/s400/Bokeh_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5558464122903685186" border="0" /&gt;&lt;/a&gt;increase filter size&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_GKvgMH3qkR0/TSOhqg-6E1I/AAAAAAAAAhU/KoA9mzVn7ec/s1600/Bokeh_2.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 400px;" src="http://2.bp.blogspot.com/_GKvgMH3qkR0/TSOhqg-6E1I/AAAAAAAAAhU/KoA9mzVn7ec/s400/Bokeh_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5558464116885689170" border="0" /&gt;&lt;/a&gt;and here is the      hexagon shape...&lt;br /&gt;note that any shape could be done with no cost!&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;and a video...&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-7ef12dfa3928eb31" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v20.nonxt4.googlevideo.com/videoplayback?id%3D7ef12dfa3928eb31%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D68C2A59C1AAE202BF493A13745EE249F87AB33DF.801708FA942057E7C318796EFB95D3BDD5616ADC%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D7ef12dfa3928eb31%26offsetms%3D5000%26itag%3Dw160%26sigh%3Dm8OB-890EPH6vNJqHOQsF_cSBxM&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v20.nonxt4.googlevideo.com/videoplayback?id%3D7ef12dfa3928eb31%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D68C2A59C1AAE202BF493A13745EE249F87AB33DF.801708FA942057E7C318796EFB95D3BDD5616ADC%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D7ef12dfa3928eb31%26offsetms%3D5000%26itag%3Dw160%26sigh%3Dm8OB-890EPH6vNJqHOQsF_cSBxM&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;real time video of lens effect / bokeh&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;with the new gpu's features and dx11 we can do it in real time, right?&lt;br /&gt;well... yes, but we don't really need dx11 or 10... ;p&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;  what we really need the heavy duty guns! Fast Fourier Transform or FFT in short...&lt;br /&gt;cya until next time...&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-7004136512421134982?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/7004136512421134982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=7004136512421134982' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7004136512421134982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7004136512421134982'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2011/01/lens-effect-bokeh.html' title='Lens Effect / Bokeh'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_GKvgMH3qkR0/TSOeoZVFVoI/AAAAAAAAAhM/TxJWTUumbTM/s72-c/Josefina_with_Bokeh.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-5896032995336606955</id><published>2010-12-02T12:35:00.000-08:00</published><updated>2010-12-02T13:24:50.377-08:00</updated><title type='text'>Deferred Iterative Parallax Mapping</title><content type='html'>hi&lt;br /&gt;the title name is a "bomb" but its nothing too fancy...&lt;br /&gt;just added parallax mapping using  iterative scheme, this method uses  few iterations of parallax mapping  in order to get more accuracy.&lt;br /&gt;for those who doesn't familiar with parallax mapping, here is a short description:&lt;br /&gt;1. you need two texture maps: height, normal map&lt;br /&gt;2. start from  current texcoord used to sample your diffuse map (for  example) and offset it by the height value (scaled and biased) of the  current pixel in the direction you view direction (in texture/tangent  space)&lt;br /&gt;3. sample your diffuse map with the new texcoord.&lt;br /&gt;iterative parallax mapping does just like that, but for X iteration, every iteration tries to move one step closer to more accurate solution.&lt;br /&gt;don't  get me wrong, you are not going to get better solution than a ray  traced methods (depends on you viewing angle, at some angles you can't even tell the difference), but this method cost almost nothing, especially if you  can save your height map values in normal map alpha channel.&lt;br /&gt;also num  iteration can be changed depending on surface properties and such.&lt;br /&gt;here is screenshots thats shows it in action using deferred method:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_GKvgMH3qkR0/TPgI1ZN2mcI/AAAAAAAAAhA/9UhxLpm41fs/s1600/Parallax_0.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 294px;" src="http://2.bp.blogspot.com/_GKvgMH3qkR0/TPgI1ZN2mcI/AAAAAAAAAhA/9UhxLpm41fs/s400/Parallax_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5546192654501845442" border="0" /&gt;&lt;/a&gt;without parallax&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_GKvgMH3qkR0/TPgI1GN8AgI/AAAAAAAAAg4/zm5tZ_RJPDI/s1600/Parallax_1.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 294px;" src="http://3.bp.blogspot.com/_GKvgMH3qkR0/TPgI1GN8AgI/AAAAAAAAAg4/zm5tZ_RJPDI/s400/Parallax_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5546192649401926146" border="0" /&gt;&lt;/a&gt;with parallax (4 iterations)&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-5896032995336606955?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/5896032995336606955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=5896032995336606955' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/5896032995336606955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/5896032995336606955'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2010/12/deferred-iterative-parallax-mapping.html' title='Deferred Iterative Parallax Mapping'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_GKvgMH3qkR0/TPgI1ZN2mcI/AAAAAAAAAhA/9UhxLpm41fs/s72-c/Parallax_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-6798365075653847959</id><published>2010-10-27T02:55:00.000-07:00</published><updated>2010-10-28T01:26:19.972-07:00</updated><title type='text'>OIT - Order Independent Transparency #3</title><content type='html'>&lt;div style="text-align: left;"&gt;hi&lt;br /&gt;&lt;/div&gt;recently i needed to do OIT  in DX9 HW and as you know (from my previous posts), i don't have the  same access i have in DX11 (i can't create linked list per pixel and do  the sorting after), so what i can do is simple depth peeling...&lt;br /&gt;few  words about depth peeling: depth peeling works by peel geometry with  specific depth value, so to create OIT we can peel geometry starting  from the nearest depth (to the camera eye) going to the farthest depth,  each step we peel few pixels and store them to in separate RT, then we  composite those RT's in back to front order to achieve the right  transparency order effect.&lt;br /&gt;so how do we implement that?&lt;br /&gt;well, from  what we can see we need color RT to store the result, also a depth  buffer so we could compare pixels depth against, we also need a "second"  depth buffer so we could reject pixels that already peeled/visited.&lt;br /&gt;1. color RT supported by DX9 and upper&lt;br /&gt;2. first depth buffer, also supported but...&lt;br /&gt;3. second depth buffer, not supported but...&lt;br /&gt;so  we have issues with 2,3, to implement pixel depth compression we need  to have the ability to pass depth buffer into the pixel shader so we  could do the compare ourselves so we could reject already peeled/visited  pixels, BUT DX9 doesn't even let us bind depth buffer as texture (even  if i'm not writing to it - can be done in DX10, but we need DX9), so we  need a way to emulate depth buffer that can be bind as texture and act  as depth buffer.&lt;br /&gt;to do this we can use float point RT, for the OIT we  will use 2 float point RT, the first one used for first pass, second  for the second pass, then the first again and so on, this is our  ping/pong depth RT's.&lt;br /&gt;the reason we need this kind of ping/pong RT's is to peel the correct layer every pass.&lt;br /&gt;for example:&lt;br /&gt;to peel the first layer we need empty depth buffer, the we render and store it to our color RT&lt;br /&gt;to  peel the second layer, we need to use the depth buffer from the first  pass, so we could ignore the pixels handled at the first layer&lt;br /&gt;to  peel the third layer, we need to use the depth buffer from the second  pass, so we could ignore the pixels handled at the second layer (and  first layer)&lt;br /&gt;and so on... you can see that we don't need more then 2 depth buffer to manage all those passes.&lt;br /&gt;ok,  so now we can peel layers with our depth buffer RT's, but how can do  OIT for more than 8 layers? (we can only bind 8/16 texture), well here  comes the reverse depth peeling (RDP) technique, instead of peeling in  front to back order, peel with back to front order, so every time you  peel one layer you can immediately composite it to the back buffer, so  only one color buffer needed.&lt;br /&gt;total memory needed could be one of those:&lt;br /&gt;1. 3 RT's, two 32 bit float point and one RGBA&lt;br /&gt;2. 2 RT's, one 32 bit float point for both depth buffer, and one RGBA&lt;br /&gt;NOTE: in deferred rendering you can get rid of the RGBA buffer.&lt;br /&gt;so as you can see, total memory is very low.&lt;br /&gt;after all the talking, here comes a video that shows RDP in action:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-25ae3e5a66370861" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v21.nonxt5.googlevideo.com/videoplayback?id%3D25ae3e5a66370861%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D85565EB0DE75220CE7A3127C391C167C15B25E66.6C0C53DFEDAFF4CF2B0C7F45C6E996442890C90F%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D25ae3e5a66370861%26offsetms%3D5000%26itag%3Dw160%26sigh%3DtT8opAHNKSrFvqiOZLh_LSPp8uE&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v21.nonxt5.googlevideo.com/videoplayback?id%3D25ae3e5a66370861%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D85565EB0DE75220CE7A3127C391C167C15B25E66.6C0C53DFEDAFF4CF2B0C7F45C6E996442890C90F%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D25ae3e5a66370861%26offsetms%3D5000%26itag%3Dw160%26sigh%3DtT8opAHNKSrFvqiOZLh_LSPp8uE&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;simple planes shows the idea, this model doesn't need per pixel sorting but it shows that the algorithm works well.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_GKvgMH3qkR0/TMkyxxvK6OI/AAAAAAAAAgw/6SCtugp8gXA/s1600/OIT_DX9_1.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 299px;" src="http://1.bp.blogspot.com/_GKvgMH3qkR0/TMkyxxvK6OI/AAAAAAAAAgw/6SCtugp8gXA/s400/OIT_DX9_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5533009447947528418" border="0" /&gt;&lt;/a&gt;Teapot model - needs per pixel sorting&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_GKvgMH3qkR0/TMkyxzcppsI/AAAAAAAAAgo/ecpBrleu9Wc/s1600/OIT_DX9_2.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 299px;" src="http://4.bp.blogspot.com/_GKvgMH3qkR0/TMkyxzcppsI/AAAAAAAAAgo/ecpBrleu9Wc/s400/OIT_DX9_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5533009448406722242" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;NOTE: technique implemented in render monkey, the video shows very simple mesh containing 8 planes so it will be easy to see the effect.&lt;br /&gt;each peeled layer render with small alpha value, so you can see how layers blended when you see through all layers (you get the white color)&lt;br /&gt;some performance info: RM window 1272x856 ATI 5850 - 270+ FPS&lt;br /&gt;thats it for now, cya...&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-6798365075653847959?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/6798365075653847959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=6798365075653847959' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6798365075653847959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6798365075653847959'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2010/10/oit-order-independent-transparency-3.html' title='OIT - Order Independent Transparency #3'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_GKvgMH3qkR0/TMkyxxvK6OI/AAAAAAAAAgw/6SCtugp8gXA/s72-c/OIT_DX9_1.jpg' height='72' width='72'/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-515185080499307702</id><published>2010-10-10T10:49:00.000-07:00</published><updated>2010-10-10T11:15:00.138-07:00</updated><title type='text'>Post Anti-Aliasing</title><content type='html'>hi&lt;br /&gt;recently i'v added few post effects and i thought i need some AA solution to remove those jaggy edges.&lt;br /&gt;traditional AA solution have its quality, no questions but it have some drawbacks:&lt;br /&gt;1. deferred or semi deferred need special care and will need DX10+.&lt;br /&gt;2. needs more memory&lt;br /&gt;3. eat gpu power&lt;br /&gt;i guess there is more but this is enough for me to consider some other solution, not the same quality but better than none.&lt;br /&gt;so what i did is pretty simple:&lt;br /&gt;1. run edge detection&lt;br /&gt;2.  run post AA which samples 4 pixels and use the value from 1 to know if  its an edge or not, if its an edge i output the filtered pixel, if not i  output none filtered pixel.&lt;br /&gt;the heart of the algorithm is 1, what i did is taking few neighbors pixels and check for a big change in their  depths/normals (for normals i check angles, for depth i check the gradients from  center pixel)&lt;br /&gt;again, very simple but i think it does the work, very fast and its generic for xbox,ps3,pc...&lt;br /&gt;here is few screenshots that shows you the process&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_GKvgMH3qkR0/TLIBHjtPIeI/AAAAAAAAAgg/C6Y_YA5o04Y/s1600/PostAA_0.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_GKvgMH3qkR0/TLIBHjtPIeI/AAAAAAAAAgg/C6Y_YA5o04Y/s400/PostAA_0.png" alt="" id="BLOGGER_PHOTO_ID_5526480922092708322" border="0" /&gt;&lt;/a&gt;Without Post AA&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_GKvgMH3qkR0/TLIBGKngEjI/AAAAAAAAAgY/XvwPjiKpupY/s1600/PostAA_1.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_GKvgMH3qkR0/TLIBGKngEjI/AAAAAAAAAgY/XvwPjiKpupY/s400/PostAA_1.png" alt="" id="BLOGGER_PHOTO_ID_5526480898177897010" border="0" /&gt;&lt;/a&gt;Edge Detection&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_GKvgMH3qkR0/TLIBEx4mOkI/AAAAAAAAAgQ/h7lQd-pU-uI/s1600/PostAA_2.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_GKvgMH3qkR0/TLIBEx4mOkI/AAAAAAAAAgQ/h7lQd-pU-uI/s400/PostAA_2.png" alt="" id="BLOGGER_PHOTO_ID_5526480874358848066" border="0" /&gt;&lt;/a&gt;With Post AA&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-515185080499307702?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/515185080499307702/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=515185080499307702' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/515185080499307702'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/515185080499307702'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2010/10/post-anti-aliasing.html' title='Post Anti-Aliasing'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_GKvgMH3qkR0/TLIBHjtPIeI/AAAAAAAAAgg/C6Y_YA5o04Y/s72-c/PostAA_0.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-962477821681733502</id><published>2010-09-10T09:48:00.001-07:00</published><updated>2010-09-10T10:10:02.804-07:00</updated><title type='text'>Deferred Decals</title><content type='html'>hi&lt;br /&gt;this time i improved my decals system.&lt;br /&gt;one of the things that   make decals looks real is the way it interact with the environment   lighting and how it clipped against the world geometry...&lt;br /&gt;the old   decals system has good clipping but it was rendered using a forward   rendering, so it didn't  interact with environment lights/shadows which  look  very strange when you put decals in a dark room with small candle  light.&lt;br /&gt;another thing is, decals on dynamic entities, which need to take into account fast clipping against those entities.&lt;br /&gt;to   fix problem 1, i replaced the forward renderer into a deferred one,  which  rendered the decals into two render targets (using MRT support),  one rt  for diffuse color and the other for normals, then in the  rendering pass i  blend the diffuse/normal with surfaces diffuse/normals  to get the final  image.&lt;br /&gt;to fix the second one, i change the way i  create collision data, each object in the scene that needs collision  detection keeps handle to collision tree which used to get the needed  data when doing clipping, collisions etc...&lt;br /&gt;that's it for now, i think the result are pretty good...&lt;br /&gt;here is a screen shots that show it in action:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_GKvgMH3qkR0/TIpiz7cTNTI/AAAAAAAAAfw/D55PVRNFhHw/s1600/DeferredDecals_0.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_GKvgMH3qkR0/TIpiz7cTNTI/AAAAAAAAAfw/D55PVRNFhHw/s400/DeferredDecals_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5515329337937835314" border="0" /&gt;&lt;/a&gt;wall rendered without decal on it&lt;br /&gt;the small picture in the top left shows diffuse term of lighting&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_GKvgMH3qkR0/TIpi0OAodTI/AAAAAAAAAf4/TRYhH7iRMTk/s1600/DeferredDecals_1.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_GKvgMH3qkR0/TIpi0OAodTI/AAAAAAAAAf4/TRYhH7iRMTk/s400/DeferredDecals_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5515329342922061106" border="0" /&gt;&lt;/a&gt;wall rendered with decal on it&lt;br /&gt;notice the bump map generated from the decal normals&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_GKvgMH3qkR0/TIplZqOiGqI/AAAAAAAAAgA/HM-Bs6AZfMQ/s1600/DeferredDecals_2.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_GKvgMH3qkR0/TIplZqOiGqI/AAAAAAAAAgA/HM-Bs6AZfMQ/s400/DeferredDecals_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5515332185174973090" border="0" /&gt;&lt;/a&gt;physical entity rendered without decal on it&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_GKvgMH3qkR0/TIplZzwl_cI/AAAAAAAAAgI/9INEfXJ2jac/s1600/DeferredDecals_3.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_GKvgMH3qkR0/TIplZzwl_cI/AAAAAAAAAgI/9INEfXJ2jac/s400/DeferredDecals_3.jpg" alt="" id="BLOGGER_PHOTO_ID_5515332187733753282" border="0" /&gt;&lt;/a&gt;physical entity rendered with decal on it&lt;br /&gt;note that when i "shot" the decal on the box, i apply impulse on the box so it moves a little&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-962477821681733502?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/962477821681733502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=962477821681733502' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/962477821681733502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/962477821681733502'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2010/09/deferred-decals.html' title='Deferred Decals'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_GKvgMH3qkR0/TIpiz7cTNTI/AAAAAAAAAfw/D55PVRNFhHw/s72-c/DeferredDecals_0.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-4330662020797783423</id><published>2010-08-05T12:57:00.000-07:00</published><updated>2010-08-05T13:00:03.219-07:00</updated><title type='text'>Editor Updates</title><content type='html'>hi&lt;br /&gt;last weeks i worked hard to make the editor useful in the meaning  that i actually build full level with physics, lights, logic and all  game play feature i could and would want to have.&lt;br /&gt;to support future  feature that i might want to have but i can't really think of them right  now, i added something i called "generic entity system", this system  basically allow me to define any entity i want by specifying entity  params which also define the ui elements needed to define and set those  params, i also support serialization, which load and save those params  automatically.&lt;br /&gt;params can be scalar, vectors, color, file, string, multiple selection values etc...&lt;br /&gt;with the system, i define the main entities that allow me to build full working level:&lt;br /&gt;1. light entity - define lights in the scene such as: point/spot/sun/dir light&lt;br /&gt;2. player entity - define player start position when the level is up&lt;br /&gt;3. physics constraints entity - define physics constraints such as spherical/hinge/fixed etc.&lt;br /&gt;4. fx entity - define special effect using my effect system&lt;br /&gt;5. model entity - define geometric model to be placed in the scene&lt;br /&gt;&lt;br /&gt;the  last time i wrote about the editor is said that i added boolean  operation which helps me to build brushed that i could build the level  from, after long thinking i decided that it wont be good in the long  term as brushes i good for old school bsp and stuff like that.&lt;br /&gt;the  things is my engine doesn't do any assumption about the scene is being  static, this means that everything can move and the engine will handle  with no problem.&lt;br /&gt;as for the visibility issue, i want to replace my  portals with hierarchia z buffer occlusion culling (but this will be in  another post...)&lt;br /&gt;&lt;br /&gt;when i finish to work on the scene, i save it as a .map file, this is very similar format to the old quake map because it fit my generic entity system and all the entities written into it will all the needed params. it also very easy to parse it, used to load q4 maps, so i fit like a glove ;p&lt;br /&gt;anyway, here is a screen shot that shows my progress:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_GKvgMH3qkR0/TFsWTmlnCkI/AAAAAAAAAfg/dsMA0UetuTk/s1600/Editor_1.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 308px;" src="http://3.bp.blogspot.com/_GKvgMH3qkR0/TFsWTmlnCkI/AAAAAAAAAfg/dsMA0UetuTk/s400/Editor_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5502015895794813506" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;the left toolbar is my action bar which i create all entities, manipulate scale/rotation/position.&lt;br /&gt;the right window is the entity property grid which allow me to modify selected entity params.&lt;br /&gt;the button window is the log windows, where i write all the action and info to the user.&lt;br /&gt;that's it for now, cya...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-4330662020797783423?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/4330662020797783423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=4330662020797783423' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4330662020797783423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4330662020797783423'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2010/08/editor-updates.html' title='Editor Updates'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_GKvgMH3qkR0/TFsWTmlnCkI/AAAAAAAAAfg/dsMA0UetuTk/s72-c/Editor_1.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-7150852158885900543</id><published>2010-06-08T05:32:00.000-07:00</published><updated>2010-06-08T07:18:58.467-07:00</updated><title type='text'>Multiple API Render</title><content type='html'>hi&lt;br /&gt;recently i didn't post a lot because the engine was down, not all things worked because replace the current render system with new one.&lt;br /&gt;my engine use dx9 api for the rendering and when dx11 was out i wanted to integrate it, to do that i had two options:&lt;br /&gt;1. replace all dx9 related code with dx11&lt;br /&gt;2. create generic render system to support any render api (dx9, dx10, dx11, opengl, whatever)&lt;br /&gt;after doing some thinking i got to the conclusion that option 2 will be the best.&lt;br /&gt;option 1: good if i want dx11 only (win vista+) and supporting only dx11 features, if in the future ms decide to change few api and add few shader stages, this will be a mess to change and add those.&lt;br /&gt;option 2: take some time to do, but will support anything you need and will need in the future (its all about how you design your api)&lt;br /&gt;&lt;br /&gt;now i will describe few things i think is important to know when implementing option 2 with dx9, dx11 support (in case you will need to do it for some project).&lt;br /&gt;&lt;br /&gt;the biggest challenge was to replace my shader system, i mainly use the dx effect framework because it seems like the best choice and very easy to use.&lt;br /&gt;one of the features i use in techniques to apply different shaders, for example: when you generate shadow maps for a fench you want to reject pixels using alpha value sampled from a texture, and when you render opaque surfaces you don't, so you need 2 techniques, one for each.&lt;br /&gt;features that the new shader system must to support are:&lt;br /&gt;1.  support any shader stages we have now and new ones that will be added in the future (if any), also it must support the technique feature so i won't need to change a lot of the code that already assume techniques.&lt;br /&gt;2. keep track of constants, sampler states, textures etc, so it won't set the same constant again and again when it already set, or set texture when it is already binded.&lt;br /&gt;3. ability to compile shaders for different api (for example: dx9 shader - shader model 3, and dx11 shaders - shader model 5, or opengl glsl shaders)&lt;br /&gt;4. easy to use - setting shader data must be easy and understandable from the name of the functions.&lt;br /&gt;&lt;br /&gt;supporting 1: done using file of each stage (.vs, .ps, .gs etc)&lt;br /&gt;supporting 2: done using few variables that store the last state (dirty value vars)&lt;br /&gt;supporting 3: done using a script that defines every technique and the stage shaders, this script supports the define macro so i could select which stage shaders and other defines to load and set depending on api macro, for example:&lt;br /&gt;#if DX11&lt;br /&gt;  code block&lt;br /&gt;#endif&lt;br /&gt;the code block will be parsed only if the current renderer is dx11.&lt;br /&gt;note that this script also solved the techniques issue because it contain the techniques that defines which shaders to bind when the technique is set.&lt;br /&gt;when i create a shader from this script the shader is actually a multi shader as it contain few shaders and not one (each technique contain shader per stage), so this script is my multi shader script definition.&lt;br /&gt;supporting 4: well, this is the easiest i think...&lt;br /&gt;&lt;br /&gt;the next challenge was state management.&lt;br /&gt;from dx10 all render states replaced with state objects: rasterizer, depth-stencil, blend and sampler state object. so you can't call SetRenderState anymore.&lt;br /&gt;to solve this issue, we can do few things:&lt;br /&gt;1. emulate dx10+ state objects using dx9 style render states (SetRenderState functions)&lt;br /&gt;2. emulate dx9 render states using state objects.&lt;br /&gt;1. in some cases you want option 1, in fact i implemented this at work where all the developers used to work with SetRenderState style.&lt;br /&gt;to do this, you can use hash for the state object and create it on the fly when it's not in the hash.&lt;br /&gt;2. this is what i did in my engine, 99% of the states is known in advance so no need to create state object on the fly, for the other 1%, when it happens, there must be a new object/mesh that was loaded so his material was loaded too, and all states objects was created (on the fly).&lt;br /&gt;each state is tracked and managed so there the state will be state only once (when needed)&lt;br /&gt;&lt;br /&gt;another thing that took a lot of time is to convert the dx9 shaders into both dx9/11 shaders using files each stage.&lt;br /&gt;instead of duplicating the files and rewrite them using dx11 functions, i added render system define (DX9 for directx9, DX11 for directx11 etc) which is added automatically for each shader i compile and use it to know which function to use, for example:&lt;br /&gt;#if DX9 == 1&lt;br /&gt;    col = tex2D(diffuseSampler, UV);&lt;br /&gt;#else&lt;br /&gt;    col = diffuseTexture.Sample(diffuseSampler, UV);&lt;br /&gt;#endif&lt;br /&gt;when i need to recreate specific shader stage for DX11 only (for example: using tessellation), i write the shaders (add domain, hull shader files) and add their filenames the multi shader script (the same can be done for optimizing shaders to use the new dx11 functions, for example: blur and pcf can be optimized using gather function)&lt;br /&gt;&lt;br /&gt;for now, the render system supports only dx9,dx11 render paths, opengl can be added by implementing the renderer functions.&lt;br /&gt;note that i kept dx9 renderer path so i know every thing was implemented right in dx11 renderer, this is mainly to validate every function i wrote in dx11 renderer.&lt;br /&gt;everything renderer with dx11 renderer must be the same (using only dx9 features) using dx9 renderer.&lt;br /&gt;&lt;br /&gt;thats it for now, i hope will find this info useful, if you have any question on topics i didn't or forgot to cover, feels free to ask...&lt;br /&gt;cya&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-7150852158885900543?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/7150852158885900543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=7150852158885900543' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7150852158885900543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7150852158885900543'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2010/06/multiple-api-render.html' title='Multiple API Render'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-43214916038558078</id><published>2010-05-10T03:08:00.001-07:00</published><updated>2010-05-10T04:57:41.113-07:00</updated><title type='text'>OIT - Order Independent Transparency #2</title><content type='html'>hi&lt;br /&gt;recently i'm very busy converting my engine into cross renderer  supporting both dx 9,11 and maybe gl in the future, so until i will  finish it and have some nice features to show here is a complex &amp;amp; large model  (50k) using OIT from the last post.&lt;br /&gt;note that this scene isn't complex compared to the simple 31 planes in terms of solving the OIT problem (because the fragments counts in the linked list is low =&gt; less pixel work).&lt;br /&gt;for the ones who interesting in fps: 1024 x 768 with ati 5850&lt;br /&gt;1. planes scene: avg 180&lt;br /&gt;2. this scene: avg 230&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_GKvgMH3qkR0/S-fcpnaSFqI/AAAAAAAAAfI/UHJz1zcYQn8/s1600/OTI_NdotL.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_GKvgMH3qkR0/S-fcpnaSFqI/AAAAAAAAAfI/UHJz1zcYQn8/s400/OTI_NdotL.jpg" alt="" id="BLOGGER_PHOTO_ID_5469582879976724130" border="0" /&gt;&lt;/a&gt;N dot L&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_GKvgMH3qkR0/S-fcp7WXs3I/AAAAAAAAAfQ/vaLjc5pPS7U/s1600/OIT.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_GKvgMH3qkR0/S-fcp7WXs3I/AAAAAAAAAfQ/vaLjc5pPS7U/s400/OIT.jpg" alt="" id="BLOGGER_PHOTO_ID_5469582885329023858" border="0" /&gt;&lt;/a&gt;Output of OIT&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_GKvgMH3qkR0/S-fcqWrwutI/AAAAAAAAAfY/GtJoNyA1FoY/s1600/OIT_Count.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_GKvgMH3qkR0/S-fcqWrwutI/AAAAAAAAAfY/GtJoNyA1FoY/s400/OIT_Count.jpg" alt="" id="BLOGGER_PHOTO_ID_5469582892666501842" border="0" /&gt;&lt;/a&gt;Fragments Count&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-43214916038558078?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/43214916038558078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=43214916038558078' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/43214916038558078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/43214916038558078'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2010/05/oit-order-independent-transparency-2.html' title='OIT - Order Independent Transparency #2'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_GKvgMH3qkR0/S-fcpnaSFqI/AAAAAAAAAfI/UHJz1zcYQn8/s72-c/OTI_NdotL.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-183973409596574811</id><published>2010-03-31T10:32:00.000-07:00</published><updated>2010-03-31T11:47:41.367-07:00</updated><title type='text'>OIT - Order Independent Transparency</title><content type='html'>hi&lt;br /&gt;recently i'm checking dx11 features and one of the nice thing he  have is read/write/structured buffers. (unlike shader model 4 that have  read only buffers)&lt;br /&gt;read/write buffer (or RWBuffer) is just as it  sounds, a buffer that we can use to read from or/and write into.&lt;br /&gt;structured  buffers (or SB) is a buffer that contains elements (c style structs),  for example:&lt;br /&gt;struct MyStruct&lt;br /&gt;{&lt;br /&gt;float4 color;&lt;br /&gt;float4 normal;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;then,  we can use it like this:&lt;br /&gt;StructuredBuffer mySB;&lt;br /&gt;mySB[0].Normal = something&lt;br /&gt;&lt;title&gt;New Resource Types&lt;/title&gt;&lt;script src="linkcss.js"&gt;&lt;/script&gt;&lt;link rel="stylesheet" href="xbox_backsdk4.css"&gt;&lt;link rel="stylesheet" type="text/css" href="HxLink.css"&gt;&lt;style&gt;             p.clsInfo {margin-bottom:0px;margin-top:2px}                          span.clsWarning {display:none}                                               span.clsPreliminary {color:#C1C0C0}             span.clsLink{color:blue;cursor:pointer;}             &lt;/style&gt;&lt;xml&gt;&lt;/xml&gt;&lt;mshelp:keyword index="A" term="60035df9-ef27-4a25-7e3d-1afa90b97417"&gt;&lt;/mshelp:keyword&gt;&lt;mshelp:attr name="AssetId" value="60035df9-ef27-4a25-7e3d-1afa90b97417"&gt;&lt;/mshelp:attr&gt;&lt;mshelp:attr name="TargetOS" value="Windows"&gt;&lt;/mshelp:attr&gt;&lt;mshelp:attr name="DocSet" value="Visual C++"&gt;&lt;/mshelp:attr&gt;&lt;mshelp:attr name="DocSet" value="WCSDK"&gt;&lt;/mshelp:attr&gt;&lt;mshelp:attr name="DocSet" value="LHSDK"&gt;&lt;/mshelp:attr&gt;&lt;mshelp:attr name="DocSet" value="PSDK"&gt;&lt;/mshelp:attr&gt;&lt;mshelp:attr name="HelpPriority" value="1"&gt;&lt;/mshelp:attr&gt;&lt;mshelp:attr name="Locale" value="kbEnglish"&gt;&lt;/mshelp:attr&gt;&lt;mshelp:keyword index="K" term="New  Resource Types"&gt;&lt;/mshelp:keyword&gt;&lt;mshelp:attr name="TopicType" value="kbOrient"&gt;&lt;/mshelp:attr&gt;&lt;mshelp:keyword index="K" term="Byte  Address Buffer (Overview)"&gt;&lt;/mshelp:keyword&gt;&lt;mshelp:keyword index="K" term="Read/Write Buffer (Overview)"&gt;&lt;/mshelp:keyword&gt;&lt;mshelp:keyword index="K" term="Structured Buffer (Overview)"&gt;&lt;/mshelp:keyword&gt;&lt;mshelp:keyword index="K" term="Unordered Access Buffer"&gt;&lt;/mshelp:keyword&gt;&lt;span style="font-family: monospace;"&gt;&lt;br /&gt;&lt;/span&gt;RWSB  have another nice feature, it have internal counter that we can increment/decrement its value.&lt;br /&gt;those buffers can be used to create  very nice effects and really fast (if used      wisely).&lt;br /&gt;this time  i'm using it to solve some old problem in computer graphics:&lt;br /&gt;order  independent transparency (or OIT), if you don't know what i'm talking  about then i suggest you should google on it...&lt;br /&gt;in dxsdk you can find  a sample called OIT, this sample uses compute shader to solve this  problem, the sample show you how you should NOT use compute shader! and  just show you that its possible using it... this sample runs so slow  that you better do a software solution for it ;)&lt;br /&gt;one thing you should  remember is: if you write your pixel shader good enough, you probably  get better performance than using compute shader (with some exception  off course)&lt;br /&gt;&lt;br /&gt;anyway, the question i want to answer is: how can we draw  transparent surfaces without worrying about the order?&lt;br /&gt;there are few  solution to this but every one of them have some drawback:&lt;br /&gt;1. depth  peeling - very heavy, even if using dual version.&lt;br /&gt;reverse depth peeling  is more friendly as it peel layers from back to front so we can blend  immediately with the backbuffer and only use one buffer for it.&lt;br /&gt;2. stencil routed k buffer - say  goodbye to your stencil and allow you up to 16 fragments to be blended,  for some of you its enough for the some its not an option.&lt;br /&gt;3. dx11  method, based on the idea presented on gdc2010 by ati.&lt;br /&gt;i will  focus on 3 as its what i implemented and it doesn't suffer  from the issues the other methods is.&lt;br /&gt;the idea can be simplify into 2  main steps:&lt;br /&gt;1. build - in this step we build linked list for every  fragment that contains all the fragments that "fall" on this fragment  screen position, i use RWBuffer to store the linked list head for that  pixel, and another 2 RWBuffers to store pixel attributes (color, depth and next  "pointer" to the next fragment in the list), those attributes buffers need  to be big enough to contain all the fragments that placed at the same fragment position.&lt;br /&gt;in this step i'm also using the structured buffer internal  counter to get unique "id" for each fragment and use it to write/read  the fragments attributes.&lt;br /&gt;&lt;br /&gt;2. resolve - this is where we do the magic,  here i just traverse the linked list stored in step 1, and sort the  fragments, then i manually blend the fragments.&lt;br /&gt;note that you need to  sort the fragments in place! that means your linked list should be  accessed a lot or... you can simply fill a bunch of registered, and sort them instead.&lt;br /&gt;tip: use the  [earlydepthstencil] attribute to skip pixels that aren't needed to be  processed.&lt;br /&gt;&lt;br /&gt;here is a screenshots that show it in action using 32 registers (max of 32 fragments per screen fragment)&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_GKvgMH3qkR0/S7OUltooNKI/AAAAAAAAAe4/m3pyfUZm_RE/s1600/OIT_1.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_GKvgMH3qkR0/S7OUltooNKI/AAAAAAAAAe4/m3pyfUZm_RE/s400/OIT_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5454866949301875874" border="0" /&gt;&lt;/a&gt;31 transparent surfaces&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_GKvgMH3qkR0/S7OUl6UhVkI/AAAAAAAAAfA/DblsaQZUyPM/s1600/OIT_2.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_GKvgMH3qkR0/S7OUl6UhVkI/AAAAAAAAAfA/DblsaQZUyPM/s400/OIT_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5454866952707200578" border="0" /&gt;&lt;/a&gt;debug mode that shows the fragments count in each of the fragments linked list&lt;br /&gt;black means 0 fragments, white means 32 fragments (num_fragments/max_fragments)&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;yes i know, this 32 surfaces can be easily sorted and rendered correctly without the GPU, but here i'm not sorting and not worrying about the order! i'm just rendered them as one batch, maybe next time i will show complex geometry... ;)&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-183973409596574811?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/183973409596574811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=183973409596574811' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/183973409596574811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/183973409596574811'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2010/03/oit-order-independent-transparency.html' title='OIT - Order Independent Transparency'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_GKvgMH3qkR0/S7OUltooNKI/AAAAAAAAAe4/m3pyfUZm_RE/s72-c/OIT_1.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-8932289411341869523</id><published>2010-03-15T11:45:00.000-07:00</published><updated>2010-03-15T12:33:06.672-07:00</updated><title type='text'>Real-Time Destruction/Fractures</title><content type='html'>hi&lt;br /&gt;in the last two weekends i'v been working on real time destruction/fractures on 3d models, i always amazed by havok destruction demonstration and even more by red fraction guerrilla.&lt;br /&gt;unlike havok physics/animation, havok destruction isn't free, but i really wanted something like that in my engine.&lt;br /&gt;after few days of thinking and googling, i got few options on how to implement it:&lt;br /&gt;1) get into some really nasty physics using fem model, build tetrahedrons that fit to the model and use it to know which part do i need to break.&lt;br /&gt;2) voxelize the model and use the voxels to know which part do i need to break.&lt;br /&gt;3) clip the model by a plane.&lt;br /&gt;every option need to take care two things:&lt;br /&gt;1) the render model which is the model that you render and contain valid tnb vectors, mapping, position etc.&lt;br /&gt;2) the physics model which you use to do collision with.&lt;br /&gt;&lt;br /&gt;the option i  implement is 3, because it is very fast to implement, doesn't need to preprocess the mesh like option 1 and does not restrict you with same fracture size like option 2.&lt;br /&gt;also it doesn't take extra memory to store data per model, everything is computed in real time, so if you are not breaking the model it is just like any other model in the scene.&lt;br /&gt;if you break it, it will take the memory needed to store fractures data and that's it.&lt;br /&gt;as you all know (or don't), nothing comes for free, more memory means less cpu work and less memory means more cpu work.&lt;br /&gt;this is always the dilemma when implementing an algorithm, but in this case its not because you can't really preprocess the fractures because you don't really know where the player is going to shot the model.&lt;br /&gt;some games generating fractures in advance and when you shot on the model, the closest fractures is detached from the parent model, in my opinion its doesn't do the work like the real thing and again, memory could be huge if you split the model into small fractures.&lt;br /&gt;another thing to take into account is how many time do you have to implement it, if you don't really have a limit i think you can find some cool idea...&lt;br /&gt;anyway, option 3 can be simplified in few steps:&lt;br /&gt;1. determine the model that you hit, call it M (your physics engine should do the job)&lt;br /&gt;2. split M by a plane into two parts, negative and positive, call them N and P&lt;br /&gt;3. close the holes of N, P using triangulation  algorithm (ear cutting or something similar), if you assume convex shapes you can simply build a fan to close those holes very fast.&lt;br /&gt;4. apply uv mapping for the faces that closed N,P holes.&lt;br /&gt;5. build physic shapes for N and P.&lt;br /&gt;thats it, the catch is to do those steps fast!&lt;br /&gt;here is a video to show what i'v done so far, note that in the video step 4 is disabled and you see the same color (all vertices map into 0,0) that's because i need to add option to give faces from step 3 different material so it will look good and not using #1 texture i used in the video&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-64a12d13461e8993" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v3.nonxt3.googlevideo.com/videoplayback?id%3D64a12d13461e8993%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D56371B8855EB20F5585828F17911ACCC26945FA5.5069DC0A4E7A327683CBD2F1782C282ACEE24170%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D64a12d13461e8993%26offsetms%3D5000%26itag%3Dw160%26sigh%3DLD-2DIekEfVK4QoXYVqGGbdDW3s&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v3.nonxt3.googlevideo.com/videoplayback?id%3D64a12d13461e8993%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D56371B8855EB20F5585828F17911ACCC26945FA5.5069DC0A4E7A327683CBD2F1782C282ACEE24170%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D64a12d13461e8993%26offsetms%3D5000%26itag%3Dw160%26sigh%3DLD-2DIekEfVK4QoXYVqGGbdDW3s&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-8932289411341869523?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/8932289411341869523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=8932289411341869523' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8932289411341869523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8932289411341869523'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2010/03/real-time-destructionfractures.html' title='Real-Time Destruction/Fractures'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-306458444675186104</id><published>2010-02-24T02:51:00.000-08:00</published><updated>2010-02-24T04:30:52.184-08:00</updated><title type='text'>DX11 Hardware Tessellation</title><content type='html'>hi&lt;br /&gt;recently i got a new job and i got new radeon 5850 which supports dx11 so i stated to check out those nastly new dx11 features, and let me tell you that: hw tessellation is COOOOL.&lt;br /&gt;little info, dx11 tessellation works with 3 new stages added:&lt;br /&gt;1.) the hull shader (aka HS) - get [1..32] input control points of the patch and responsible to output [1..32] new control points, it is also output constants which control how much to subdivide each patch.&lt;br /&gt;2) the tessellator (fixed-function) - get the output of the hull shader as input and generate the new points, you have no control on this stage.&lt;br /&gt;3) the domain shader (aka DS) - generates surface geometry from the transformed control points from a hull  shader and the UV coordinates. the DS run once for each point generated in step 2, the input of DS is bary coords of the point on the patch so you could easily interpolate vectors other than position and uv.&lt;br /&gt;HS supports 4 different partitioning methods, topology and few more things (check out dx sdk if you are interested on the tiny details)&lt;br /&gt;so why do we need it if we already have geometry shader? well, geometry shader is programmable and generic in a way that you can do whatever you want in it, such has point sprites, fur, object silhouette and more but its not free and not optimized for things like tessellation. in dx11 you have dedicated unit for doing tessellation so the speed can't even compared with gs.&lt;br /&gt;here is a video that shows dx11 tessellation with adaptive tessellation:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-387e804e72c71882" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v13.nonxt1.googlevideo.com/videoplayback?id%3D387e804e72c71882%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D4CC9B5513057C438330B638DD860F0DF6E746DFC.862BCE09417CFB7010A5EE3689B2F49E1D6720C0%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D387e804e72c71882%26offsetms%3D5000%26itag%3Dw160%26sigh%3DtcD7eoEQdENEERoqXJB8CglEA_M&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v13.nonxt1.googlevideo.com/videoplayback?id%3D387e804e72c71882%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D4CC9B5513057C438330B638DD860F0DF6E746DFC.862BCE09417CFB7010A5EE3689B2F49E1D6720C0%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D387e804e72c71882%26offsetms%3D5000%26itag%3Dw160%26sigh%3DtcD7eoEQdENEERoqXJB8CglEA_M&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;note that the geometry passed is simple 4 vertices quad.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-306458444675186104?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/306458444675186104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=306458444675186104' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/306458444675186104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/306458444675186104'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2010/02/dx11-hardware-tessellation.html' title='DX11 Hardware Tessellation'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-4741149218187294852</id><published>2010-01-23T05:14:00.000-08:00</published><updated>2010-01-27T12:24:46.668-08:00</updated><title type='text'>Atmospheric scattering</title><content type='html'>hi&lt;br /&gt;this time i'm showing atmospheric scattering using oneil atmospheric scattering from gpu gems 2.&lt;br /&gt;to implement it correctly i started with cpu based solution which computed all the nasty integrals on cpu and store it in a texture, this cpu solution used so i can debug and fix issues with the integral computations.&lt;br /&gt;after everything works on cpu i convert it to gpu version and use it as default.&lt;br /&gt;this texture is then mapped on a sky dome where camera eye is at origin.&lt;br /&gt;clouds are procedurally generated using few noise textures, they also change their color based on sun direction.&lt;br /&gt;for now i'm not taking into account sun lighting, shadowing this is simple solution so the sky wont look empty.&lt;br /&gt;here is a short video to show it in action:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-fa53aab1d0af76ea" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v1.nonxt5.googlevideo.com/videoplayback?id%3Dfa53aab1d0af76ea%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D7861025A5343EC2A409996259C7058973AE41050.6AC7CD56F286570E2A065B217277586263F741C0%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Dfa53aab1d0af76ea%26offsetms%3D5000%26itag%3Dw160%26sigh%3DWNJM-9nxu6jmdgXGkZ4gM8Wsna8&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v1.nonxt5.googlevideo.com/videoplayback?id%3Dfa53aab1d0af76ea%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D7861025A5343EC2A409996259C7058973AE41050.6AC7CD56F286570E2A065B217277586263F741C0%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Dfa53aab1d0af76ea%26offsetms%3D5000%26itag%3Dw160%26sigh%3DWNJM-9nxu6jmdgXGkZ4gM8Wsna8&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-4741149218187294852?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/4741149218187294852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=4741149218187294852' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4741149218187294852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4741149218187294852'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2010/01/atmospheric-scattering.html' title='Atmospheric scattering'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-7690294336877478286</id><published>2009-12-21T11:48:00.000-08:00</published><updated>2009-12-21T12:53:55.879-08:00</updated><title type='text'>Stable Shadows</title><content type='html'>hi&lt;br /&gt;this time i worked on stabilizing the flickering when doing cascaded/pssm shadow maps.&lt;br /&gt;if you had the chance to do cssm/pssm you know what i'm talking about, you can't ignore those flickering when you move your camera (panning/rotating).&lt;br /&gt;the first game i know who solve this problem was kill zone 2, nothing to say about this game!&lt;br /&gt;i'v a lot of respect to those guys :)&lt;br /&gt;anyway, if you don't know what i'm talking about and what those flickers are, let me explain (i can't promise you will understand it but i will still try...)&lt;br /&gt;i will talk about cssm from now, the same idea works for pssm.&lt;br /&gt;when you render your shadows you are creating/generating your shadow matrix whenever the view changes (your camera view), if this change is very small and almost smooth you are fine but if not, the shadows boundaries are rendered or more correctly rasterized differently which cause visible flickering of the shadow edges.&lt;br /&gt;the more area your farther shadows (farther cascaded) will cover the more you will notice it.&lt;br /&gt;ok, get the idea, how do i solve it? well, i split it into 2 cases:&lt;br /&gt;1. rotation problem&lt;br /&gt;2. moving/panning problem&lt;br /&gt;case 1: can be solved by eliminating the rotation of the shadow maps when our camera is rotated (this cause our shadow map to be rasterized differently) , we can use smallest enclosing sphere of the cascaded frustum and use it to generate our cascaded matrices, using the center as the lookat target and the radius to generate the orthogonal projection matrix.&lt;br /&gt;this assure that your shadow maps will not rotate with the camera.&lt;br /&gt;case 2: can be solved by canceling the movement in sub-texel level, this can be archived by multiplying a fixed world position with our cascaded matrix, round the result and see how much it differs from your fixed world position, note that this must be calculated in shadow map space in order to get the right offset. we now use this offset to translate our cascaded matrix.&lt;br /&gt;note that my implementation is different, i use bounding box slice selection and different flickering solution which is very sable (can't give info about that because we are working on a big project so i need to keep few tricks inside)&lt;br /&gt;here is a video to show the translation of all those words in action :)&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-ae91386c66c6a074" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v1.nonxt6.googlevideo.com/videoplayback?id%3Dae91386c66c6a074%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D80D500C96D470C8B76A317202E5C5291C1E471BC.3022E53CD2AF9AE591394CAB902E0579C548AB18%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Dae91386c66c6a074%26offsetms%3D5000%26itag%3Dw160%26sigh%3DkelgS-y_6-rX9ilYAxoXbU5_EuI&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v1.nonxt6.googlevideo.com/videoplayback?id%3Dae91386c66c6a074%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D80D500C96D470C8B76A317202E5C5291C1E471BC.3022E53CD2AF9AE591394CAB902E0579C548AB18%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Dae91386c66c6a074%26offsetms%3D5000%26itag%3Dw160%26sigh%3DkelgS-y_6-rX9ilYAxoXbU5_EuI&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;The resolution of the shadow maps are low to make the problem more noticeable&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-7690294336877478286?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/7690294336877478286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=7690294336877478286' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7690294336877478286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7690294336877478286'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/12/stable-shadows.html' title='Stable Shadows'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-42774096266557835</id><published>2009-11-07T23:28:00.000-08:00</published><updated>2009-11-09T06:04:51.468-08:00</updated><title type='text'>Revisiting Shadows Methods</title><content type='html'>hi&lt;br /&gt;shadows are always been an issue when it comes to real-time app, there is no such thing a perfect method for shadows, until now i choose vsm for shadowing, but the more i work with them, the more i get the feeling its great for "demos" not for complex scene where shadow complexity is high , yes i know about the bleeding issues and how to minimize them, but there are scenes where you need to minimize them a lot and at the end you just get simple shadow map, and the softness you applied by blurring or such isn't noticed so much.&lt;br /&gt;because of this i started to investigate few other methods, and i must say i got really good results:&lt;br /&gt;a word about poplar shadowing methods:&lt;br /&gt;1. sm - old school shadow maps&lt;br /&gt;2. pcss - percentage closer soft shadows&lt;br /&gt;3. vsm - variance shadow maps&lt;br /&gt;4. esm - exponential shadow maps&lt;br /&gt;5. cssm - cascaded shadow maps&lt;br /&gt;6. pssm - parallel split shadow maps&lt;br /&gt;as much as it will sound odd, i choose method 1 for indoor shadows, yes, old school shadow maps with poission disk and jittering gives me very good results.&lt;br /&gt;while method 2 sound really good, its not applied very well for every scene, it also not free in terms of performance.&lt;br /&gt;anyway, i created 16 samples of poission disk and generated jitter texture which i passed to the shader. the poission disk can be tuned for more samples or less, the jittering can be tuned for more jitter or less.&lt;br /&gt;because i use two shadow maps, static for static shadows and dynamic for dynamic shadows, i managed to optimize this by using one texture with offsetting.&lt;br /&gt;method 5,6 used for outdoor scenes, i use pssm...&lt;br /&gt;here is few screenshots:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_GKvgMH3qkR0/SvZ4Lgkj7uI/AAAAAAAAAeA/75_TPLAAyzw/s1600-h/shadows1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_GKvgMH3qkR0/SvZ4Lgkj7uI/AAAAAAAAAeA/75_TPLAAyzw/s400/shadows1.jpg" alt="" id="BLOGGER_PHOTO_ID_5401636942194667234" border="0" /&gt;&lt;/a&gt;complex shadows from 2 light sources&lt;br /&gt;note that vsm will fail below the platform (light bleeding) and the fence details won't be visible even with 1k shadow maps because the compassion is based on probability and could be failed where simple compassion will pass.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_GKvgMH3qkR0/SvZ4LTXPkPI/AAAAAAAAAd4/SsXP5mBWBWw/s1600-h/shadows2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_GKvgMH3qkR0/SvZ4LTXPkPI/AAAAAAAAAd4/SsXP5mBWBWw/s400/shadows2.jpg" alt="" id="BLOGGER_PHOTO_ID_5401636938649145586" border="0" /&gt;&lt;/a&gt;complex surface casting shadows&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_GKvgMH3qkR0/SvZ4LHLc8GI/AAAAAAAAAdw/ObIBxVY4wRY/s1600-h/shadows3.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_GKvgMH3qkR0/SvZ4LHLc8GI/AAAAAAAAAdw/ObIBxVY4wRY/s400/shadows3.jpg" alt="" id="BLOGGER_PHOTO_ID_5401636935378464866" border="0" /&gt;&lt;/a&gt;zoom in on shadows&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;before you said its not so impressive, note that the 2 light sources using only 8 samples on 1k maps, the barrel is dynamic object which means the dynamic shadow map is updated and merged with static shadow maps, the fence have very tiny elements, and it all runs on my old g6600, so i think its pretty good ;)&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-42774096266557835?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/42774096266557835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=42774096266557835' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/42774096266557835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/42774096266557835'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/11/revisiting-shadows-methods.html' title='Revisiting Shadows Methods'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_GKvgMH3qkR0/SvZ4Lgkj7uI/AAAAAAAAAeA/75_TPLAAyzw/s72-c/shadows1.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-7307320177687344978</id><published>2009-09-30T04:50:00.000-07:00</published><updated>2009-09-30T05:26:43.318-07:00</updated><title type='text'>Maya Exporter</title><content type='html'>hi&lt;br /&gt;this time i talked about the maya exporter i wrote so i could defines whatever i want where i want and the why i want, without sticking to id md5 format.&lt;br /&gt;when you want to create maya exporter you have few options:&lt;br /&gt;1. create plugin dll&lt;br /&gt;2. create exe application and call maya functions&lt;br /&gt;3. create mel script&lt;br /&gt;i choose option 2 because it more easy to debug and doesn't need your maya run everytime you want to export and test something, the drawback is the you don't go to file menu in maya, select export and see your new format.&lt;br /&gt;option 3 is also good if you know mel script, but doesn't allow you to access everything in maya, and i don't think you have tools to debug it like in dev studio.&lt;br /&gt;anyway, the new format called OGE, this format designed to support both static and dynamic models.&lt;br /&gt;the structure of this format looks like this:&lt;br /&gt;MESH&lt;br /&gt;mesh_info - vertices count, texcoords count, normal count, weight_count (if animated), faces etc...&lt;br /&gt;material_info - the name to material defined in .mtr script&lt;br /&gt;mesh_data - vertices, normals, texcoords, indices etc...&lt;br /&gt;anim_data - weights, skeleton data&lt;br /&gt;&lt;br /&gt;global for all meshes&lt;br /&gt;anim_data - anim sets count, fps of each set, joints animated and their anim data&lt;br /&gt;&lt;br /&gt;the reason anim_data is shared between all meshes is because each mesh could have different influence on specific joints and those have it own skinCluster, because i don't want to manage and control animation controller per skinCluster, i'm merging those skinCluster's data into one skinCluster data and export it as it was single skin for the whole model meshes.&lt;br /&gt;each of those data is optional and could be selected from the exporter ui.&lt;br /&gt;here i a screenshot of the exporter:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_GKvgMH3qkR0/SsNJZfyaupI/AAAAAAAAAdI/5HKCvZb6t84/s1600-h/Exporter.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 365px; height: 400px;" src="http://1.bp.blogspot.com/_GKvgMH3qkR0/SsNJZfyaupI/AAAAAAAAAdI/5HKCvZb6t84/s400/Exporter.JPG" alt="" id="BLOGGER_PHOTO_ID_5387230281643768466" border="0" /&gt;&lt;/a&gt;options:&lt;br /&gt;1. convert from right to left handed (maya uses right handed, engine uses left handed)&lt;br /&gt;2. convert from Y up to Z up (engine uses z up)&lt;br /&gt;3. export position, normals, texture coordinates (possible to invert v coord)&lt;br /&gt;4. export materials&lt;br /&gt;5. export animations, possible to set animation name&lt;br /&gt;6. at right i have meshes list, this list allows me to export only the meshes i select. skinned meshes will be shown with '(skinned)' keyword after their name.&lt;br /&gt;&lt;br /&gt;the reason i have the option to overwrite animation name is that i can use the exporter to create animation files (containing only animation data without geometry data).&lt;br /&gt;the model could be created at first with one idle animation (or without animation at all), and at later point i can add more animations to it.&lt;br /&gt;also, if you have few characters with same skeleton, you don't want to duplicate all animations, you just want to have shared animation folder containing all animation files for those characters.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-7307320177687344978?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/7307320177687344978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=7307320177687344978' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7307320177687344978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7307320177687344978'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/09/maya-exporter.html' title='Maya Exporter'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_GKvgMH3qkR0/SsNJZfyaupI/AAAAAAAAAdI/5HKCvZb6t84/s72-c/Exporter.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-2038462600737721998</id><published>2009-09-29T08:05:00.000-07:00</published><updated>2009-09-29T08:52:08.659-07:00</updated><title type='text'>New Animation System</title><content type='html'>hi&lt;br /&gt;its been more than a month since i updated this blog, the reason is that i just didn't save time for taking screenshots/create a video and update the blog.&lt;br /&gt;so here i'm finding few minutes to write about the new things i implemented, hopefully updating with screenshots/videos on the next post ;)&lt;br /&gt;list of things i'v working on:&lt;br /&gt;1. new animation system&lt;br /&gt;2. abandon md5 file format and use internal format (writting exporter from maya)&lt;br /&gt;3. real-time atmospheric scattering&lt;br /&gt;4. HDR&lt;br /&gt;5. read shaderx6 :)&lt;br /&gt;&lt;br /&gt;the first thing i wanted to rewrite for along time is the animation system, calling it animation system is a nice joke, but still it could play different animations for different parts of the model, do some kind of blending and at the time it was enough.&lt;br /&gt;but the time is come and i wanted more advanced system which allows me control and create animation on the fly, adding sse and such...&lt;br /&gt;the new animation system based on blend trees, what it means is that you can apply operations/operators on trees and get a new tree as a result.&lt;br /&gt;the system designed so the operators works just like in math, you apply operator get a result and apply another operator on it and so on...&lt;br /&gt;so how this is going to help with animation?&lt;br /&gt;when doing skinned animation, you need few things:&lt;br /&gt;a. model with weights&lt;br /&gt;b. bind pose skeleton&lt;br /&gt;c. animation data for that bind pose skeleton&lt;br /&gt;this skeleton form a tree, so you can define the operations in term of animation and you are set.&lt;br /&gt;you can thing of animation as a list of skeletons which defines new position &amp;amp; orientation for this skeleton or just list of that skeleton with different poses.&lt;br /&gt;the operations i'm using is:&lt;br /&gt;a. subtract tree A from tree B - useful for separating certain parts from specific animation, for example: you have walk animation which moves both hands and legs, but you want to separate it to two new animations one that moves on the legs and another for moving the hands.&lt;br /&gt;&lt;br /&gt;b. multiple tree A with tree B - useful for merging two trees to form merged animation, for example: merging the two animation created in a and get the original animation (the one which moves both hands and legs)&lt;br /&gt;&lt;br /&gt;c. transition from tree A to tree B - the is by far the most useful operation, this create a transition from one animation to another by setting transition/blend factor [0..1], what this means is for blend factor 0 tree A will be the returned, 1 tree B will be returned, for 0.5 for example a tree between A and B will be returned. so why is it so useful? well imagine you have a character that have walk,run animations and you want to play walk animation for velocity under 10 and run over 50, but what happens between 10 and 50? well you can use the velocity to compute blend factor to be used to create smooth transition between walk and run and run to walk.&lt;br /&gt;&lt;br /&gt;when setting animation is just a matter of setting list of skeletons, but when implementing you don't want to switch from one skeleton to another in one frame, what you want is to create smooth transition between one skeleton to another, for example: skeleton from frame 1 to 2, 2 to 3, 3 to 4 and so on... the result is a skeleton inbetween old frame skeleton and current frame skeleton, this skeleton used as input to other operations.&lt;br /&gt;also, the animation system works hand by hand with the new engine format 'oge', used for both static and animated models, this format created using the new exporter i wrote.&lt;br /&gt;next time i will write about the other things i worked on...&lt;br /&gt;cya&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-2038462600737721998?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/2038462600737721998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=2038462600737721998' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2038462600737721998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2038462600737721998'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/09/new-animation-system.html' title='New Animation System'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-8411588944446913804</id><published>2009-08-20T03:58:00.000-07:00</published><updated>2009-08-20T04:08:28.356-07:00</updated><title type='text'>Deferred Lighting</title><content type='html'>hi, quick update&lt;br /&gt;last crytek presentation they show their deferred lighting system, and i thought.. hmmm, i implemented those things few months ago, doing test and stuff to see if its good, but i didn't finsih all the tiny things that make it unstable (i wanted to focus on things other the graphics &amp;amp; effect), so last week i finished handling those tiny things and here is the result:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_GKvgMH3qkR0/So0twAeuBQI/AAAAAAAAAdA/oRkRs_3MdYI/s1600-h/many_lights.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 313px;" src="http://2.bp.blogspot.com/_GKvgMH3qkR0/So0twAeuBQI/AAAAAAAAAdA/oRkRs_3MdYI/s400/many_lights.jpg" alt="" id="BLOGGER_PHOTO_ID_5372000233308685570" border="0" /&gt;&lt;/a&gt;87 dynamic lights (yes, they all cast dynamic shadows)&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-8411588944446913804?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/8411588944446913804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=8411588944446913804' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8411588944446913804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8411588944446913804'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/08/deferred-lighting.html' title='Deferred Lighting'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_GKvgMH3qkR0/So0twAeuBQI/AAAAAAAAAdA/oRkRs_3MdYI/s72-c/many_lights.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-2719761817518383351</id><published>2009-08-02T05:13:00.001-07:00</published><updated>2009-08-02T06:05:52.104-07:00</updated><title type='text'>Undo/Redo System</title><content type='html'>hi, last week i implemented undo/redo system.&lt;br /&gt;as you all know, editing software without undo/redo system is pretty useless.&lt;br /&gt;i think undo/redo system is a must in any editing software, i think the system is very simple and easy to implement (depending on the app, but still) so i can't see any reason why not supporting it.&lt;br /&gt;ok, so explained why, so now i explain (in general) how i added it to my level editor, i will explain the idea so for implementation detail just ask...&lt;br /&gt;the more generic your system is (in term of managing editable objects) the more easy it become, here i describe a system with user define max size for undo/redo (because of memory issues, you don't want to consume more than needed).&lt;br /&gt;you need to support few things before implementing it:&lt;br /&gt;1. you have to be able to take a snapshot of current scene state, meaning, every editable object must be stored in a way that could be restored later.&lt;br /&gt;2. deque container, i use deque so i could keep X oldest elements (used to limit memory used by the system), basically every container with option to add and remove from both direction will be fine.&lt;br /&gt;after you support those its just a matter of identify the places you want to support undo/redo, and wrap them with Undo_Start &amp;amp; Undo_End or whatever name you want.&lt;br /&gt;so what those functions do?&lt;br /&gt;1. Undo_Start - take a snapshot of the scene and save it in undo deque, i make sure to store a flag (lets call it done) which says if i called Undo_End or not, and i checked this flag right after i entered this function. this to assure i wont try to call Undo_Start inside Undo_Start/Undo_End block (prevent nesting), the function also gets a string so i could name the operation i wrap, useful if you want your console to output text like: Undo create new box, or undo delete...&lt;br /&gt;2. Undo_End - checks if i started undo op, and set the 'done' flag to true&lt;br /&gt;simple enough, so now we'll see how to perform undo/redo actions:&lt;br /&gt;1. Perform_Undo - pop the head from the undo deque, push it to the redo queue, and restore the snapshot you saved, i also check size limits right after pushig new element and i its greater then a max size i defined i just pop from the tail.&lt;br /&gt;2. Perform_Redo - pop the head from the redo deque, push it the the undo deque, and restore the snapshot you saved, also do same limit test as in Perform_Undo&lt;br /&gt;&lt;br /&gt;note this system could be optimized in few ways, one place to start is the snapshot function.&lt;br /&gt;how exactly you do the snapshot is depends on the app, but a simple method is to duplicate all editable objects in the scene.&lt;br /&gt;also note that the snapshot needs to run ONLY once, just before you modifying the scene.&lt;br /&gt;practical example:&lt;br /&gt;if you have 'CreateNewBox' function that you call when you click on a create new box button on main toolbar, you need to wrap this function like this:&lt;br /&gt;OnButtonCreateNewBox&lt;br /&gt;{&lt;br /&gt;   Undo_Start("Create New Box")&lt;br /&gt;   CreateNewBox()&lt;br /&gt;   Undo_End()&lt;br /&gt;}&lt;br /&gt;if your system supporting those kind of scene changes, speed isn't an issue, but if you support dragging and manipulating object properties with the mouse (like scale/rotate/move vertices/faces) you need to do some optimizations.&lt;br /&gt;that's it, pretty simple right?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-2719761817518383351?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/2719761817518383351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=2719761817518383351' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2719761817518383351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2719761817518383351'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/08/undoredo-system.html' title='Undo/Redo System'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-2125782120505518877</id><published>2009-07-19T23:43:00.001-07:00</published><updated>2009-07-20T00:07:31.804-07:00</updated><title type='text'>Building Editor</title><content type='html'>hi&lt;br /&gt;i'v thought it will be good to leave id tools (their editor) because the more the engine improved the more id editor doesn't give me good options to set the new properties the engine supports, for example, i want to create constraints and apply them to brushes or entities, until now i added new entity call constraint_hinge (for example) and then i added properties to this entity that the engine can parse and set constraint values, but the editor doesn't know its hinge constraint and can't show me the angles in the viewport, i was better if the editor could draw/show me the angles in a more friendly way so i know how to set them correctly without running the engine and testing it.&lt;br /&gt;this i just an exampe, so i started to build an editor (i always wanted to, but there was important things to do before...) which will support all engine features and option to add generic porperties to each entity (just like id editor).&lt;br /&gt;the editor isn't going to be like crysis editor, its more like ut editor which you build the level from scracth or more correcty, from basic objects, detail object could be added as well.&lt;br /&gt;right now i setup the basic ui, viewports, tools toolbar and basic manipolation on brushes such as move, scale, rotate, multi selection, also supporting copy/paste system.&lt;br /&gt;the 2d viewports support zooming and snap to grid option, the 3d viewport allow you to conrol a free camera with the mouse so you can view the scene from any angle.&lt;br /&gt;still have to finish alot of things but its getting better each day i'm working on it.&lt;br /&gt;next time i will work on it, i think i will add undo/redo system, without it i think the editor is useless ;)&lt;br /&gt;btw: no its not C# its pure c++ with mfc! uses the new feature pack which is great...&lt;br /&gt;here is a screenshot of how it looks so far:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_GKvgMH3qkR0/SmQWkn3zkYI/AAAAAAAAAc4/MP8f6URztic/s1600-h/Editor_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 305px;" src="http://4.bp.blogspot.com/_GKvgMH3qkR0/SmQWkn3zkYI/AAAAAAAAAc4/MP8f6URztic/s400/Editor_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5360434274911883650" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-2125782120505518877?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/2125782120505518877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=2125782120505518877' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2125782120505518877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2125782120505518877'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/07/building-editor.html' title='Building Editor'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_GKvgMH3qkR0/SmQWkn3zkYI/AAAAAAAAAc4/MP8f6URztic/s72-c/Editor_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-6656132924833090358</id><published>2009-06-20T23:48:00.001-07:00</published><updated>2009-06-21T00:08:37.195-07:00</updated><title type='text'>Havok Physics Demonstration</title><content type='html'>hi&lt;br /&gt;its been a long time since i posted anything, this is because i didn't have time to work on the engine... (busy busy busy)&lt;br /&gt;so here is the video of few physics elements using havok i said i will post:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-3bf07be9f5954e3c" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v21.nonxt4.googlevideo.com/videoplayback?id%3D3bf07be9f5954e3c%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D72AB1E6E0334D83139CCF8F762A5784A36832E48.55F586C07D3B63DBD0D471FEE5CE23E8B08B3084%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D3bf07be9f5954e3c%26offsetms%3D5000%26itag%3Dw160%26sigh%3DtPVIetXN_zE8jMoX5-EWYFRxyjI&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v21.nonxt4.googlevideo.com/videoplayback?id%3D3bf07be9f5954e3c%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D72AB1E6E0334D83139CCF8F762A5784A36832E48.55F586C07D3B63DBD0D471FEE5CE23E8B08B3084%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D3bf07be9f5954e3c%26offsetms%3D5000%26itag%3Dw160%26sigh%3DtPVIetXN_zE8jMoX5-EWYFRxyjI&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;few elements shown in the video:&lt;br /&gt;1. better and smooth character controller (no jittering, smooth jumping), every character/bot have its own properties set using a script.&lt;br /&gt;2. moving platform interacting with character controller, platform push everything on it, which means if something goes on the platform it will move.&lt;br /&gt;3. dynamic bridge using limited hinge constraint, i added options to add constraints via editor so this bridge is a simple brush with hinge constraint at the bottom, when the character apply enough force on it, it will fall down.&lt;br /&gt;4. smooth movement using fixed time step and interpolation, almost every physics engine (physx, bullet, havok, ode, newton etc...) have the option to use fixed time step (i use 1/60), but what this means is when appication dt goes down 1/60 you will notice slow motion and moon gravity effect because the physics simulation is updating in the right time step (which is 1/60), to overcome this we need to check for this situation and apply few interations and interpolate between last and new physics objects states if current dt is not multiple of physics dt (for more info see my post on fixed time step or ask on the forum)&lt;br /&gt;if you have any question feel free to ask &lt;a href="http://orenk2k.forumotion.net/"&gt;http://orenk2k.forumotion.net/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-6656132924833090358?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=3bf07be9f5954e3c&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/6656132924833090358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=6656132924833090358' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6656132924833090358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6656132924833090358'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/06/havok-physics-demonstration.html' title='Havok Physics Demonstration'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-1961218580603516441</id><published>2009-05-03T07:19:00.000-07:00</published><updated>2009-05-03T08:30:25.461-07:00</updated><title type='text'>Havok Integration Completed</title><content type='html'>hi&lt;br /&gt;its been a while since i posted anything, i didn't had time to code so...&lt;br /&gt;anyway, i'v finished to integrate havok physics and got rid of any nvidia physx, i must tell you that i'm pleased with the results, havok rocks!&lt;br /&gt;few features added:&lt;br /&gt;1) anything could be physical, entities, brushes, models etc, that means i can create houses, towers directly from the editor and make it interact/break to parts very easy.&lt;br /&gt;&lt;br /&gt;2) using fixed time step, this is huge win because by default havok/physx runs great when doing the step in a fixed manner thats mean you need to choose your dt and step the simulation with it.&lt;br /&gt;why you need this thing?&lt;br /&gt;a quick example, lets say we are using dt=1/60, that means your game need to be run at 60 hz so the physics simulation will be fine, if your game runs for 30 hz that means you get slow motion physics or moon gravity effect, if you game runs at 120 hz that means your physics simulation get andernaline and runs twice as fast as you intended.&lt;br /&gt;consoles does not have this issues as the run in a fixed tv hz 25/30/60, but in pc it doesn't, so to fix this fast, you can turn on vsync and everything will be fine (at least for hardware that support it), but this way your renderer is limited to 60 hz! not so good, so the ideal solution is to run the renderer at high hz as possible and the physics at fixed hz, so what you should do is&lt;br /&gt;to simulate the physics engine considering your fixed and dynamic time step and perform one or more steps of the physics simulation to achive smooth motion, using interpolator.&lt;br /&gt;in our example (dt=1/60) if the game run at 30 hz we should perform 2 physics updates, if the game run at 5 hz we should do more, if the game runs at 120 hz we should do on update per 0.5 updates, meaning one update per 2 frames.&lt;br /&gt;to deal with this i use accumulator and interpolation factor, the accumulator used to know how much updates we should do (you should set max steps so you wont freeze the game when the steps goes to high) and the interpolation factor used to interpolate between prev and current states of the objects, used when game dt isn't multiple of our fixed dt (if for example we are running at 45 hz and not 60 hz, we should perform 1.5 updates, but we can't do 0.5 update, so instead we do 2 updates and use 0.5 as the interpolation factor).&lt;br /&gt;if you want to know more details on the subject please ask at the forum...&lt;br /&gt;&lt;br /&gt;3) character controller interaction with physical objects, moving platform moves the controllers, the controller blocks other physical objects, other physical objects can push the controller, characters can push other characters and more.&lt;br /&gt;&lt;br /&gt;4) character motion properties set by the script, so each bot can have different abilities, jump height, movment speed etc.&lt;br /&gt;&lt;br /&gt;5) ragdoll are much more stable, angles limits are set very easy via scripts, havok have greate contraint for doing shoulder joint limits.&lt;br /&gt;&lt;br /&gt;i probably forget few things but those are the main features.&lt;br /&gt;i already have some scenes that shows those in action, but as usual i prefered to code few min more than capture a movie :)&lt;br /&gt;as usual, if you have any question feel free to ask &lt;a href="http://orenk2k.forumotion.net/"&gt;http://orenk2k.forumotion.net/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-1961218580603516441?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/1961218580603516441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=1961218580603516441' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/1961218580603516441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/1961218580603516441'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/05/havok-integration-completed.html' title='Havok Integration Completed'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-2733739533574960040</id><published>2009-04-05T03:14:00.000-07:00</published><updated>2009-04-05T03:55:42.533-07:00</updated><title type='text'>Moving to Havok</title><content type='html'>hi&lt;br /&gt;well, the day has come and i realize that nvidia physx isn't good enough for my game play physics, so i started to read havok physics sdk and i really like it, its not simple as physx but gives better control over things like character controller, ragdolls, ray casts etc.&lt;br /&gt;why i'm doing it right now and not waiting after i release a demo?&lt;br /&gt;the things is the physics is very important part of the game especially the character controller, so i prefer doing it before and have solid system than say: "i cant do it now, its a lot of work".&lt;br /&gt;few things i found physx is very bad at:&lt;br /&gt;1. filters, not enough and not general so i could filter collision detecting between objects and such, for example: i want to the bot to shot but i dont want it to collide with its ragdoll! i solved it via bits filtering but limit to only 32 bots.&lt;br /&gt;2. character controller! smooth collision nice handling with different shapes (box, sphere, capsule) but very very bad in interacting other physics element, the thing is that this character controller (cct) is placed outside the physical system and perform sweep test against the world to do sliding and stairs handling.&lt;br /&gt;so interacting with other rigid bodies is done via collision callback that tells you which bodies the cct collide with and allows you to add forces to do the pushing effect, but what about other rigid bodies that pushing the cct? well this is not possible! because the cct is a kinematic object which means its static! and have high priority over other none kinematic objects.&lt;br /&gt;so doing moving platforms that allows the cct to stand and moving with them isn't possible! you can do it by doing dirty hacks and maybe you get the right results but it will jitter a lot and wont perform very well.&lt;br /&gt;those are 2 things i can't compromise and because of them (mostly because the cct) i move to havok, which have great cct and let you chose the one which fits better to your game, they have rigid body cct and proxy cct which acts like physx cct (placed outside of the physical system and do sweep test and such), when you choose rigid body cct it means it part of  the physical system and everything works! meaning you can push things, things can push you, moving platform become very easy to do.&lt;br /&gt;they also have very generic filtering system and ragdoll support, they even have animation  support which works with ragdoll physics and ik so you can do animation with ik and enable ragdoll physics when you want.&lt;br /&gt;there alot of things i didn't mentioned but i think that if you need good physics system and you dont want to compromise you should select it very carfull or you end up changing it like me :)&lt;br /&gt;so in two words: Havok Rocks!&lt;br /&gt;cya until next time...&lt;br /&gt;&lt;br /&gt;if you have any question feel free to ask &lt;a href="http://orenk2k.forumotion.net/"&gt;http://orenk2k.forumotion.net/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-2733739533574960040?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/2733739533574960040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=2733739533574960040' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2733739533574960040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2733739533574960040'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/04/moving-to-havok.html' title='Moving to Havok'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-7733566929926802074</id><published>2009-03-27T08:07:00.000-07:00</published><updated>2009-03-27T08:16:08.812-07:00</updated><title type='text'>Triggers in Action</title><content type='html'>hi, after i finished to update my system (installing and updating few things)  i remembered that i said i will put some video to show triggers in action so i created a small map with a box attached to ceiling with few physics objects inside, so when i touch the trigger the box will be opened and the objects will fall down.&lt;br /&gt;this is very simple example of using trigger_once (which trigger his targets only once), other triggers could be use at the same manner to achieve more complex behavior.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-1ea1c61872fe5113" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v8.nonxt2.googlevideo.com/videoplayback?id%3D1ea1c61872fe5113%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D573AABD36982BF117516D0AB7DCDA5EAF1E2005B.287860C51467C8B59E5A9CC938B0E78D9E135136%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D1ea1c61872fe5113%26offsetms%3D5000%26itag%3Dw160%26sigh%3DCIWRa4elXZ0vTvIi4XNBlakjQG0&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v8.nonxt2.googlevideo.com/videoplayback?id%3D1ea1c61872fe5113%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D573AABD36982BF117516D0AB7DCDA5EAF1E2005B.287860C51467C8B59E5A9CC938B0E78D9E135136%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D1ea1c61872fe5113%26offsetms%3D5000%26itag%3Dw160%26sigh%3DCIWRa4elXZ0vTvIi4XNBlakjQG0&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;using triggers&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;if you have any question feel free to ask &lt;a href="http://orenk2k.forumotion.net/"&gt;http://orenk2k.forumotion.net/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-7733566929926802074?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=1ea1c61872fe5113&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/7733566929926802074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=7733566929926802074' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7733566929926802074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7733566929926802074'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/03/triggers-in-action.html' title='Triggers in Action'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-2453020258385507117</id><published>2009-03-21T11:12:00.000-07:00</published><updated>2009-03-21T11:34:06.485-07:00</updated><title type='text'>Doing some maintenance</title><content type='html'>hi, this week i did some      maintenance, something i want to do for a long time is to replace my hard disk, my current hdisk (old 80 gb) start to do some noises so i thought its time to replace it, so i buy new 320 gb and clone everything.&lt;br /&gt;i thought i will be fast and simple but the new norton ghost is so bad, i just want to do simple task (as i did in the dos days) and they make it so hard, they change the option for cloning hdisk to copy hard drive option which allows you to clone only one partition at a time and not the whole hdisk as one unit.&lt;br /&gt;so i searched for another app, and i found really good software 'Acronis True Image Home', this is the best app i found for doing the job, very easy to use and have a lot of options to backup things. anyway i use it and it work perfectly.&lt;br /&gt;i also install source control software (which i didn't use until now), the project become very big with a lot of files and it become very complicate to control it, so i installed svn (which i also use it at work), i really like this software, very fast and relaible.&lt;br /&gt;the last thing i did is to upgrade my dev system to vs2008, i was using vs2003 which wasn't so great, i hope the new one will perform much better :)&lt;br /&gt;thats it for now, bye&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-2453020258385507117?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/2453020258385507117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=2453020258385507117' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2453020258385507117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2453020258385507117'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/03/doing-some-maintenance.html' title='Doing some maintenance'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-4036461481825527640</id><published>2009-03-11T07:15:00.000-07:00</published><updated>2009-03-27T08:16:23.252-07:00</updated><title type='text'>Triggers</title><content type='html'>hi, long time i didn't post anything, i'v been busy at work and also wanted to try few techniques and to read few articles from gpu gems 3 and gpg 7, i'm going to get a new copy of ai game programming wisdom 4 which will complete my series so i'm really looking forward to read it.&lt;br /&gt;anyway, after checking some new methods on the graphics side (deferred methods) i wanted to get on with the gameplay so i decided to add new triggers to support interesting level design stuff.&lt;br /&gt;background on triggers for those who are not familiar with it.&lt;br /&gt;trigger is a convex volume which triggers an event when game entity (player, bots, projectiles etc) touches it.&lt;br /&gt;simple example for using triggers: you place a door and want it to be opened only if you get nearer, so you place a trigger around the door but make it a little bit bigger so you will touch the trigger before you touch the door, you set the target of the trigger to be the door so when you touch it it will send a 'trigger' message to the door.&lt;br /&gt;each trigger have basic attributes:&lt;br /&gt;1) target - name of the entity that will be triggered when we touch the trigger, we can set multiple targets.&lt;br /&gt;2) message - message to desplay when triggered&lt;br /&gt;3) delay - amount of time between the touching and the actual triggering&lt;br /&gt;there are few more relative to trigger type.&lt;br /&gt;the triggers i'v added so far:&lt;br /&gt;1) trigger_once - triggers only once, when it is triggered you can't trigger it again, can be used to destroy a bridge after you pass on it.&lt;br /&gt;2) trigger_multiple - triggers multiple times, you can set wait time before the trigger will be trigger again when touched.&lt;br /&gt;3) trigger_hurt - apply damage when touched, can set damage amount.&lt;br /&gt;thats the main idea of triggers, i'v few more to add and there is cool stuff you can make with them.&lt;br /&gt;next time i hope i will finish the rest and upload some video to show some action.&lt;br /&gt;bye&lt;br /&gt;as always if you have any question feel free to ask &lt;a href="http://orenk2k.forumotion.net/"&gt;http://orenk2k.forumotion.net/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-4036461481825527640?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/4036461481825527640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=4036461481825527640' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4036461481825527640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4036461481825527640'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/03/triggers.html' title='Triggers'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-3279427665748152431</id><published>2009-02-15T01:07:00.001-08:00</published><updated>2009-02-15T01:09:17.212-08:00</updated><title type='text'>Custom Deformation</title><content type='html'>hi, quick update about new feature i'v added into material system called custom deform.&lt;br /&gt;this feature allow you to create specific deformation on a geometry batch.&lt;br /&gt;by saying specific i mean that you define 3 functions/expressions (anything you want), to define the deformation on x,y,z component of each vertex in the batch.&lt;br /&gt;for example:&lt;br /&gt;here is a material definition for sin wave deformation:&lt;br /&gt;materialTestDeform&lt;br /&gt;{&lt;br /&gt;deform custom 0, sin(time+VertexIndex), 0&lt;br /&gt;}&lt;br /&gt;ok, what this simple material does to any geometry using it, is applying a sin wave deformation on each vertex on the y component. (the x,z component doesn't do anything as its 0)&lt;br /&gt;time - internal keyword returning game time in ms&lt;br /&gt;VertexIndex - internal keyword returning current vertex index of the vertex we are going to deform.&lt;br /&gt;i could also use it to do some old scholl water deformation (using height map) by doing something like this:&lt;br /&gt;materialWaterDeform&lt;br /&gt; {&lt;br /&gt; deform custom 0, heightMapTexture[256*VertexPos.y+256*VertexPos.x], 0&lt;br /&gt; }&lt;br /&gt; heightMapTexture - is the dynamic 256x256 height map texture&lt;br /&gt;VertexPos.x/y/z - internal keyword returning current vertex component of the vertex we are going to deform.&lt;br /&gt;this is just a few examples of using this new feature (you probably wont apply this water deformation as its not fast enough and could be done faster using the gpu)&lt;br /&gt;because this deformation is based on the functions you define (its not constant), this could not be done in the gpu so its take some cpu time.&lt;br /&gt;  thats all for now.&lt;br /&gt;if you have any question feel free to ask &lt;a href="http://orenk2k.forumotion.net/"&gt;http://orenk2k.forumotion.net/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-3279427665748152431?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/3279427665748152431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=3279427665748152431' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/3279427665748152431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/3279427665748152431'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/02/custom-deformation.html' title='Custom Deformation'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-7841994245444963089</id><published>2009-02-04T00:16:00.000-08:00</published><updated>2009-02-04T00:33:54.311-08:00</updated><title type='text'>Forum For All</title><content type='html'>hi&lt;br /&gt;i decided to open a forum to discus my engine programming and game development in general.&lt;br /&gt;the main idea of the forum is to be the place to ask questions and hopefully get answers :)&lt;br /&gt;it also contain game design area which allow you to share you work and show what you got, the main idea of this section is to get in contact with some talented users who would like to help with new models, animations, level design etc.&lt;br /&gt;i still post news here but if you have any questions about something (new or old), i would like you to ask it in the forum, so enjoy and cya in the forum :)&lt;br /&gt;forum address:&lt;br /&gt;&lt;a href="http://orenk2k.forumotion.net/"&gt;http://orenk2k.forumotion.net/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-7841994245444963089?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/7841994245444963089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=7841994245444963089' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7841994245444963089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7841994245444963089'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/02/forum-for-all.html' title='Forum For All'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-2174153639162002694</id><published>2009-01-25T00:16:00.000-08:00</published><updated>2009-01-25T02:38:14.740-08:00</updated><title type='text'>Improving Shadows System Continued</title><content type='html'>hi, last post i let you think on answer to some question about shadow updating scheme.&lt;br /&gt;in short, the problem was that if dynamic entity gets into influence area of the light it means the light needs to update his shadow map, but this turns to be very intensive if this area contains lots of detail models which is static (read the last post to get the details and comments...)&lt;br /&gt;ok, so the solution to this problem could be one of:&lt;br /&gt;(1) two shadow maps for each light&lt;br /&gt;(2) stay with one shadow map per light but...&lt;br /&gt;(3) other&lt;br /&gt;lets check those options:&lt;br /&gt;(1) two shadow maps for each lights is the way to go but still raise some problems:&lt;br /&gt;a. more memory (twice), if the light taken 1.5 mb per cube shadow map, now it will take 3mb!,&lt;br /&gt;not so good as the reason i use shadow cache system is to maximize shadows cound and minimize the memory used by them.&lt;br /&gt;b. we need to merge those shadow maps to get final one so we could use it when rendering, so we need another shadow maps for this! still the merging process isn't for free so i think you get the idea way this option isn't so good.&lt;br /&gt;(2) here i stay with one shadow map per light but i use another shadow map which will be shared for all lights, this second shadow map will only used for dynamic geometry, so the unique shadow map per light stay ONLY for static geometry and the shared one ONLY for dynamic geometry.&lt;br /&gt;so the memory issue solved, what about the merging? well, instead of merging those shadow maps in cpu, we merge them on gpu.&lt;br /&gt;sound good but that means we need another shadow map right? not necessity, what i do is binding those shadow maps and merge them inside ps, and then i compute shadow map as usual. so instead of using the value sampled from one shadow map, i use the merged sample.&lt;br /&gt;this method saved the need for another shadow map and the extra pass for merging them.&lt;br /&gt;(3) other? nothing i see now, but maybe you could think of something?...&lt;br /&gt;in practice its work very well and the performance gain is huge.&lt;br /&gt;here is two screenshots show the results using this method:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_GKvgMH3qkR0/SXw9iYZTC-I/AAAAAAAAAcw/Nbj3D4kX0Z8/s1600-h/HybridShadows_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_GKvgMH3qkR0/SXw9iYZTC-I/AAAAAAAAAcw/Nbj3D4kX0Z8/s400/HybridShadows_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5295174922754264034" border="0" /&gt;&lt;/a&gt;using both static &amp;amp; dynamic shadows&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_GKvgMH3qkR0/SXw9iTXVVSI/AAAAAAAAAco/1-C1EjvbXXg/s1600-h/HybridShadows_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_GKvgMH3qkR0/SXw9iTXVVSI/AAAAAAAAAco/1-C1EjvbXXg/s400/HybridShadows_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5295174921403847970" border="0" /&gt;&lt;/a&gt;using only static shadows&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;i see those screenshots but what is so special about them? its just shadow maps...&lt;br /&gt;well yes and no, the first screenshot shows simple scene with few static geometry and one dynamic pickup item (armor), the only shadow map that is being updated is the dynamic shadow map, so what you see is the result of merging two shadow maps in the ps, so you can see both static and dynamic shadows.&lt;br /&gt;the second screenshot shows the same scene but this time we picked up this item, so the resulting shadow map taken only from the static shadow map (dynamic one is empty!)&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-2174153639162002694?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/2174153639162002694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=2174153639162002694' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2174153639162002694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2174153639162002694'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/01/improving-shadows-system-continued.html' title='Improving Shadows System Continued'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_GKvgMH3qkR0/SXw9iYZTC-I/AAAAAAAAAcw/Nbj3D4kX0Z8/s72-c/HybridShadows_1.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-6451621426690776804</id><published>2009-01-19T00:14:00.000-08:00</published><updated>2009-01-19T01:16:35.236-08:00</updated><title type='text'>Improving Shadows System</title><content type='html'>hi&lt;br /&gt;recently i'm working on performance issues and such, one of the biggest challenge in this area is shadows and how do we make them faster?&lt;br /&gt;the answer to this question is another question:&lt;br /&gt;how much cpu and memory can we sacrifice for this?&lt;br /&gt;the answer to this one is: it depends on other process in the game and your platform.&lt;br /&gt;so here i'm working on pc platform where memory is not an issue (like in ps2/xbox/ps3) so the main question is:&lt;br /&gt;what do you do if you have big scene with 5000 point lights that need to cast dynamic shadows?&lt;br /&gt;lets say we can determine their visibility very fast, so the bottleneck is the shadows generation and not the visibility of the lights. another assumption is that the lights is mostly static but if at any time we want some of the lights become dynamic, we could.&lt;br /&gt;so the answer to this question can be one of those:&lt;br /&gt;1. use light maps&lt;br /&gt;2. compute all shadow map at load time&lt;br /&gt;3. other&lt;br /&gt;well, lets check those methods one by one:&lt;br /&gt;1. light maps is out of the question because they are static and if a light is moving, his shadows wont be updated. also if we have a bridge and we walk beneath, the shadows of the bridge wont cast on our character, because when we compute those light maps, our character wasn't there.&lt;br /&gt;2. this sound promising, it solved the problems in 1 but has another problem.&lt;br /&gt;each point light using cube map for his shadow maps, that means 6 maps for each side, so if we take for example 256 by 256 cube map for all the lights we get something like 1.5 mb per light (assuming 4 bytes per pixel), this become 1.5*5000=7500 mb!! = 7.5 gigs, this is huge and of course cant be done in the real world when we have limited memory.&lt;br /&gt;3. so what we need is a solution that solve both 1 and 2 and take reasonable memory, so the solution i come with is to use a cache system for shadows.&lt;br /&gt;this system will have specific amount of memory dedicated to shadows and based on priority value we computed for each light the system will give cache entry for the most important lights (that is for example: the lights with large range and closer to the viewer).&lt;br /&gt;so basically the system work with x entries that keeps shadow maps and set them as needed to the right lights, when we set shadow entry, we flag the light that he needs to update his shadows, this way we wont spend memory for far lights the viewer wont even see.&lt;br /&gt;so when the scene loaded, the system set shadow entries for the most important lights and when the light tries to generate his shadows we check:&lt;br /&gt;a. is this light have shadow entry? if not it means this light is not important and wont generate shadows.&lt;br /&gt;b. is this light already updated his shadows or not? if not it means the light become dirty or someone flag the light that he need to update shadows (see below)&lt;br /&gt;if we have shadow entry and the light needs to update his shadows, we get the shadow maps from cache entry and generate shadow maps for shadow maps stored in this entry.&lt;br /&gt;when we done, we flag this light that he update his shadows so next frame we wont update it again.&lt;br /&gt;few thing we need to consider:&lt;br /&gt;1. if entity that cast shadows get inside light bounds, the light must update his shadows so the shadows of the entity will get in.&lt;br /&gt;2. if the light is moving we need to update his shadows maps.&lt;br /&gt;ok, so this is the main idea of the system and it is very fast and generic and as any algorithm, this have some tiny things that need to be done correctly so it works smoothly and handle all the special cases.&lt;br /&gt;before i finish, here is another question:&lt;br /&gt;what if we have a room with 500,000 faces with one point light that cast shadows?&lt;br /&gt;we use this great shadows cache system :)&lt;br /&gt;right, but what if an entity, lets say a small ball with 16 faces get inside that room?&lt;br /&gt;hmm, the light need to update his shadows so the shadows of the entity will get in.&lt;br /&gt;well, thats right but that means that for this tiny entity with only 16 faces you need to generate shadows from 500,000+16 faces???&lt;br /&gt;think about it until next time...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-6451621426690776804?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/6451621426690776804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=6451621426690776804' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6451621426690776804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6451621426690776804'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/01/improving-shadows-system.html' title='Improving Shadows System'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-8435749070903823049</id><published>2009-01-13T03:22:00.000-08:00</published><updated>2009-01-13T03:54:14.280-08:00</updated><title type='text'>Volumetric Flares</title><content type='html'>hi&lt;br /&gt;while changing some of my render batches design to support static and dynamic batches better and faster, i decided to add this nice fake volume effect that i called light flares or volume flares.&lt;br /&gt;unlike the simple 4 vertices billboard/sprite flares that we rotate to face the camera those flares are different and look much better.&lt;br /&gt;when editing the map i place quad shapes aligned with scene geometry and gives them the special flares material, inside the engine i build special border extruded by specific size (defined inside material script) and make sure they always face the viewer.&lt;br /&gt;i also make sure the flare wont be visible if the camera position placed behind.&lt;br /&gt;when the position of the camera is at front and smoothly become behind, i take the distance from camera position to the flare plane and use it to compute flare intensity so the flare will smoothly become invisible the more the camera become closer.&lt;br /&gt;also i bind it a built-in texture which encoded a quadratic function so the borders of will have a smooth falloff effect.&lt;br /&gt;there are few tiny things here and there (setting texcoords and such) but this is the main idea.&lt;br /&gt;here is a screenshot to show this in action:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_GKvgMH3qkR0/SWx81hpL4fI/AAAAAAAAAcY/a9UnBggc9uA/s1600-h/Flares_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_GKvgMH3qkR0/SWx81hpL4fI/AAAAAAAAAcY/a9UnBggc9uA/s400/Flares_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5290740921259516402" border="0" /&gt;&lt;/a&gt;Volumetric Flare Around Fluorescent&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;note that this volume shape changed relative to viewer position so it will be different when looking from other position, but the volumetric effect will be preserved.     &lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-8435749070903823049?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/8435749070903823049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=8435749070903823049' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8435749070903823049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8435749070903823049'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/01/volumetric-flares.html' title='Volumetric Flares'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_GKvgMH3qkR0/SWx81hpL4fI/AAAAAAAAAcY/a9UnBggc9uA/s72-c/Flares_0.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-5590357571652122513</id><published>2009-01-11T00:22:00.000-08:00</published><updated>2009-01-11T01:30:09.682-08:00</updated><title type='text'>Improving Area Visibility</title><content type='html'>hi&lt;br /&gt;last time i talked about my new visibility system and how i compute lights and areas visibility, this time i improved my visibility system in a way that i could know the visibility inside each area and not just which areas are visible.&lt;br /&gt;i call it internal area pvs, this pvs use the same mechanism of bitsets and gives me information about all the entities/surfaces etc that are visible inside specific area.&lt;br /&gt;at first it sound like, why do you need it? well, when running big levels each area have lots of detail in term of level design and also game play by placing high detail models and pickup items, those can take a lot of power when rendering.&lt;br /&gt;also note that computing internal area pvs is very fast and done when doing the portal traversal, so with a few lines i save lots of rendering, also what you don't see does not need to be lit so the saving is huge when doing the lighting pass!&lt;br /&gt;here is 2 screenshots that shows it in action:&lt;br /&gt;NOTE: the images in wireframe mode so you could see the data the visible without and with internal area pvs system.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_GKvgMH3qkR0/SWmy0cCSq7I/AAAAAAAAAcI/PCZy9iJ164A/s1600-h/InterAreaPVS_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_GKvgMH3qkR0/SWmy0cCSq7I/AAAAAAAAAcI/PCZy9iJ164A/s400/InterAreaPVS_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5289955851272104882" border="0" /&gt;&lt;/a&gt;without internal area pvs&lt;br /&gt;notice the small red entities at the right side&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_GKvgMH3qkR0/SWmy0uVy81I/AAAAAAAAAcQ/ra_fvmKjoQI/s1600-h/InterAreaPVS_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_GKvgMH3qkR0/SWmy0uVy81I/AAAAAAAAAcQ/ra_fvmKjoQI/s400/InterAreaPVS_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5289955856185750354" border="0" /&gt;&lt;/a&gt;with internal area pvs&lt;br /&gt;notice the red entities at the right side was removed along with other surfaces&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;the red entities in the images are light flares, which is a nice effect to fake volume light effects. note that unlike billboard/sprites those are not simple quad aligned to camera view, next time i talked about them...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-5590357571652122513?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/5590357571652122513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=5590357571652122513' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/5590357571652122513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/5590357571652122513'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2009/01/improving-area-visibility.html' title='Improving Area Visibility'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_GKvgMH3qkR0/SWmy0cCSq7I/AAAAAAAAAcI/PCZy9iJ164A/s72-c/InterAreaPVS_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-6396641245601855842</id><published>2008-12-30T02:11:00.000-08:00</published><updated>2008-12-30T02:49:40.039-08:00</updated><title type='text'>Visibility System And Shadow Casters</title><content type='html'>hi, last days i'v been working on my visibility system, rendering system and redesign few things related to them, also fix some low performance issues in big levels.&lt;br /&gt;so in order to attack those issues i stared so see what could be optimized, one thing was the pvs data set which was basically a list of visible objects created from specific view point.&lt;br /&gt;this pvs is needed for both camera and lights, also mirror materials needs to generate this set for the mirror generation pass.&lt;br /&gt;those list was filled in few places but the thing is that we could do alot of the work in load time and achive better performance and still get the same thing.&lt;br /&gt;so instead of keeping list of scene objects which could be changed doring the game (for example: another bot got in or out), i'm using a bit set for lights and camera pvs.&lt;br /&gt;each entity update which areas they belong to, lights only update thier bit set when they move/change.&lt;br /&gt;when i want to render the scene, i only need to check camera pvs bit set and see which areas are visible. to know which entity is visible is just a matter of checking the right bits in camera bit set.&lt;br /&gt;in lighting pass we need to know which areas the current light influenced, so to get this info we need to do an AND bit operator between current light bit set and camera bit set, the result is the areas the light can influence and the camera can see.&lt;br /&gt;the same thing is done for shadows generation, that using the same light bit set pvs with an exception.&lt;br /&gt;when we are generating shadows we still need to consider shadows that comes from unvisible objects, object that is not visible still can cast visible shadow!&lt;br /&gt;to solve this issue, we should check if the shadow volume of that object is intersecting our view frustum, if so it means this object needs to be rendered into the shadow map even if its not visible!.&lt;br /&gt;if you dont handle those object you will get wrong shadows.&lt;br /&gt;for example: if you have an open space scene with sun as the only light source and simple cave built from floor, ceiling and walls. when you enter the cave and look down (ceiling is not visible!) you still want to see the shadow of the ceiling.&lt;br /&gt;here is screenshots from medium scene with unvisible shadow caster&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_GKvgMH3qkR0/SVn719nTB_I/AAAAAAAAAb4/zyPNOzKfezo/s1600-h/ShadowCaster_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_GKvgMH3qkR0/SVn719nTB_I/AAAAAAAAAb4/zyPNOzKfezo/s400/ShadowCaster_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5285532542187014130" border="0" /&gt;&lt;/a&gt;shadows off&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_GKvgMH3qkR0/SVn72ONbE_I/AAAAAAAAAcA/zn3nae8HaEo/s1600-h/ShadowCaster_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_GKvgMH3qkR0/SVn72ONbE_I/AAAAAAAAAcA/zn3nae8HaEo/s400/ShadowCaster_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5285532546641892338" border="0" /&gt;&lt;/a&gt;shadows generating from unvisible      ceiling of this hallway&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-6396641245601855842?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/6396641245601855842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=6396641245601855842' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6396641245601855842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6396641245601855842'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/12/visibility-system-and-shadow-casters.html' title='Visibility System And Shadow Casters'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_GKvgMH3qkR0/SVn719nTB_I/AAAAAAAAAb4/zyPNOzKfezo/s72-c/ShadowCaster_0.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-5597624425905820248</id><published>2008-12-14T00:21:00.000-08:00</published><updated>2008-12-14T01:10:25.795-08:00</updated><title type='text'>Portals</title><content type='html'>hi, this time i had to recreate my portals visibility system, why? well i had some nasty bug that pop out when doing my pvs (possible visibility set) on complicated levels with lots of portals crossing each other.&lt;br /&gt;i will try to explain the problem so when you see one you could attack it :)&lt;br /&gt;little info about portals for some of you who don't familiar with it.&lt;br /&gt;portals is related to visibility system because they help to cull scene areas, how?&lt;br /&gt;think for a moment on a door that connecting two rooms room A and room B, if you stand in room A and looking through the door you only can a portion of room B.&lt;br /&gt;now if you doesn't look through the door, you probably wont see room B (if you cant see the door, you cant see the room/s it leads to)&lt;br /&gt;so portals basically hand placed (can be places automatically) in few places (not just corridors) as convex polygons (usually quads).&lt;br /&gt;now, when you want to know which areas are visible, you start from camera area and check which portals inside this area, for each portal you clip your current frustum planes (the camera planes) against the portal and check again with the new clipped planes as the new frustum (yes its recursive function) and so on and on for each portal until there is nothing to see/visit.&lt;br /&gt;now each portal you enter lead you to a new area so you flag this area so you know it is visible.&lt;br /&gt;after you quit this function you end up with a list of areas that are potentially visible from camera area. this is the basic idea but few trick here and there could do this faster!&lt;br /&gt;now that you know whats portals, i try to explain why i think recursive function for portals visibility are not so good in complicating levels with lots of portals!&lt;br /&gt;the thing is that every portal you pass, the current frustum get clipped and pass for the next check, for every area you visit you also flag it so you wont check it again (this also helps to break the recursion, if not you can get stack overflow) because other portals can also leads to it.&lt;br /&gt;because of this you can have few routes (in the recursion tree) that can lead to the same area! but not all of them will result in a visible area at the end! this is because we flag all the visited areas so the other routes that start like the first one but ends different (in terms of areas) wont even ends! meaning the area at the end of their route wont even visit because the first ones was flagged as visited - resulting in a none visible area that needs to be visible!!&lt;br /&gt;i hope you didn't get lost in this long      explanation and get the idea, so here is my solution to this problem:&lt;br /&gt;the way i solve it is to look at the problem as a tree where the camera eye placed at the root, each portal is node, each branch is an area. (this is just how it help me to solve the problem).&lt;br /&gt;i scan this tree by levels!, this way the areas are visited in a sorted order relative to eye pos (the root) and all the routes advance one step at a time and not allowing one route to get to the end (leaf) and others stay at the beginning.&lt;br /&gt;here is few screenshots that shows portals in action:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_GKvgMH3qkR0/SUTL4T5v3uI/AAAAAAAAAbo/kp1xhni6XQI/s1600-h/Portals_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_GKvgMH3qkR0/SUTL4T5v3uI/AAAAAAAAAbo/kp1xhni6XQI/s400/Portals_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5279568831460663010" border="0" /&gt;&lt;/a&gt;visible portals in green, none visible in red&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_GKvgMH3qkR0/SUTL4XqASAI/AAAAAAAAAbw/zdZEIKIAV6c/s1600-h/Portals_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_GKvgMH3qkR0/SUTL4XqASAI/AAAAAAAAAbw/zdZEIKIAV6c/s400/Portals_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5279568832468371458" border="0" /&gt;&lt;/a&gt;visible portals in green, none visible in red&lt;br /&gt;yellow lines are current frustum planes&lt;br /&gt;NOTE: portals are clipped against current frustum thats why part of the portal is red and the other part is green&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-5597624425905820248?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/5597624425905820248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=5597624425905820248' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/5597624425905820248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/5597624425905820248'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/12/portals.html' title='Portals'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_GKvgMH3qkR0/SUTL4T5v3uI/AAAAAAAAAbo/kp1xhni6XQI/s72-c/Portals_0.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-3884137219269457928</id><published>2008-12-03T06:44:00.000-08:00</published><updated>2008-12-03T07:03:46.648-08:00</updated><title type='text'>Gamma Correction</title><content type='html'>hi, after reading the article "the importance of being linear" in gpu gems 3, i decided that its a good thing to add gamma correction into my engine.&lt;br /&gt;by setting the right gamma value everything will look more real and the colors get the right felling.&lt;br /&gt;there is few tecniques to do that, i decided to do it as a post process on the final pixel color by applying the function:&lt;br /&gt;gammaCorrectedColor = pow(finalColor, 1/gammaValue)&lt;br /&gt;as a bonus we can now optimize light interaction because the light bounds doesn't need to be big in order to make the effected area more clear and bright.&lt;br /&gt;also, its a good idea to make the gamma value controllable so every player could set it as needed, i'm using the console to change it.&lt;br /&gt;here is a screenshot of the effect:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_GKvgMH3qkR0/STadyV7UPqI/AAAAAAAAAbY/oy7mw--ljH8/s1600-h/Gamma_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_GKvgMH3qkR0/STadyV7UPqI/AAAAAAAAAbY/oy7mw--ljH8/s400/Gamma_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5275577501716070050" border="0" /&gt;&lt;/a&gt;without gamma correction&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_GKvgMH3qkR0/STady3w-GJI/AAAAAAAAAbg/wgZOg72jvpU/s1600-h/Gamma_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_GKvgMH3qkR0/STady3w-GJI/AAAAAAAAAbg/wgZOg72jvpU/s400/Gamma_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5275577510799480978" border="0" /&gt;&lt;/a&gt;with gamma correction&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-3884137219269457928?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/3884137219269457928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=3884137219269457928' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/3884137219269457928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/3884137219269457928'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/12/gamma-correction.html' title='Gamma Correction'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_GKvgMH3qkR0/STadyV7UPqI/AAAAAAAAAbY/oy7mw--ljH8/s72-c/Gamma_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-3401702876033820752</id><published>2008-11-22T23:48:00.000-08:00</published><updated>2008-11-23T00:05:32.716-08:00</updated><title type='text'>Mini Map</title><content type='html'>hi, one of the things that was missing for me in fps game is the way to know where i am, where do i need to go and where the hell is my enemies that keep shooting at me.&lt;br /&gt;so i thought to add this mini map feature which shows you the level (from top), you and the enemies near you, this including orientation so you know where they look at.&lt;br /&gt;for now its just shows you where is the bots in the map (including you) but eventually it will show you:&lt;br /&gt;1. your objectives&lt;br /&gt;2. war zones&lt;br /&gt;3. special items&lt;br /&gt;4. shortcuts&lt;br /&gt;and more, this list is changing from day to day but i think you got the idea :)&lt;br /&gt;here is a screenshot the shows the mini map inside the game (top left)&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_GKvgMH3qkR0/SSkOLPnFj1I/AAAAAAAAATI/Ah4qfCo_XRE/s1600-h/MiniMap_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_GKvgMH3qkR0/SSkOLPnFj1I/AAAAAAAAATI/Ah4qfCo_XRE/s400/MiniMap_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5271760425145700178" border="0" /&gt;&lt;/a&gt;yellow icon is you, red icons is other bots&lt;br /&gt;note that the detail is not so good because the image compression&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-3401702876033820752?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/3401702876033820752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=3401702876033820752' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/3401702876033820752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/3401702876033820752'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/11/mini-map.html' title='Mini Map'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_GKvgMH3qkR0/SSkOLPnFj1I/AAAAAAAAATI/Ah4qfCo_XRE/s72-c/MiniMap_0.jpg' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-2480978711801614378</id><published>2008-11-15T07:18:00.001-08:00</published><updated>2008-11-15T07:58:55.270-08:00</updated><title type='text'>Swinging Lights</title><content type='html'>hi, this time i just added new feature to my articulate figure system that i'm using for ragdolls, the new feature allow me to define any model to be physical so to test it i tried to use it for lights so i could interact with them.&lt;br /&gt;its very simple to define, just one .af script to define the bodies &amp;amp; constraints and one 3d model to attach the .af script to.&lt;br /&gt;here is a small video to show this in action:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-957dc6011d4db3ef" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v8.nonxt1.googlevideo.com/videoplayback?id%3D957dc6011d4db3ef%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D77E97FCA2B4B9AF623078B990C8BCFAB32A8D376.1D9DA47909A67384A25922643738EA222700D7F5%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D957dc6011d4db3ef%26offsetms%3D5000%26itag%3Dw160%26sigh%3D7vTYvIF8sCnvjjRL-mzpjFQkNQg&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v8.nonxt1.googlevideo.com/videoplayback?id%3D957dc6011d4db3ef%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D77E97FCA2B4B9AF623078B990C8BCFAB32A8D376.1D9DA47909A67384A25922643738EA222700D7F5%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D957dc6011d4db3ef%26offsetms%3D5000%26itag%3Dw160%26sigh%3D7vTYvIF8sCnvjjRL-mzpjFQkNQg&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-2480978711801614378?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=957dc6011d4db3ef&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/2480978711801614378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=2480978711801614378' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2480978711801614378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2480978711801614378'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/11/swinging-lights.html' title='Swinging Lights'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-2359105229633498901</id><published>2008-11-02T01:30:00.001-07:00</published><updated>2008-11-02T01:48:07.743-08:00</updated><title type='text'>Advanced Shadows</title><content type='html'>hi, last post i talked about the new render system and the improved shadow and lighting system, so here is few screenshots that shows some action:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_GKvgMH3qkR0/SQ1zwro9vNI/AAAAAAAAATA/lTCoqMbnJhU/s1600-h/AdvancedShadows_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_GKvgMH3qkR0/SQ1zwro9vNI/AAAAAAAAATA/lTCoqMbnJhU/s400/AdvancedShadows_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5263990819651435730" border="0" /&gt;&lt;/a&gt;soft particles with per pixel lighting and shadowing,&lt;br /&gt;notice the green shadows on the wall&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_GKvgMH3qkR0/SQ1zwf8CVgI/AAAAAAAAAS4/qR4lTefWEgk/s1600-h/AdvancedShadows_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_GKvgMH3qkR0/SQ1zwf8CVgI/AAAAAAAAAS4/qR4lTefWEgk/s400/AdvancedShadows_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5263990816510203394" border="0" /&gt;&lt;/a&gt;this is not projected light effect, this is true shadows generated from the fench&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;first picture shows some green smoke effect that cast green shadows, this is not precomputed effect or projected video, this is real shadows producing by the particles.&lt;br /&gt;here i show this on particles but it will work perfectly for glass and other translucent materials.&lt;br /&gt;the second picture shows shadows created from semi transparent materials, here i show this on fence but it will work for any semi transparent materials such as trees, grass etc.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;i also added some optimizations to point light shadowing by skipping cube face passes by determine if face frustum is not intersecting camera frustum.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-2359105229633498901?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/2359105229633498901/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=2359105229633498901' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2359105229633498901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2359105229633498901'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/11/advanced-shadows.html' title='Advanced Shadows'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_GKvgMH3qkR0/SQ1zwro9vNI/AAAAAAAAATA/lTCoqMbnJhU/s72-c/AdvancedShadows_1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-7517460978680035972</id><published>2008-10-27T02:19:00.000-07:00</published><updated>2008-10-27T02:57:54.677-07:00</updated><title type='text'>New Render System</title><content type='html'>Hi, recently i worked on a new render system, the old system created at the first stages of the engine just so i could render some geometry.&lt;br /&gt;the old system wasn't generic and fast, it didn't support alpha blend surfaces very well and optimize material and stage binds, also shadows for special media wasn't supported and was hard to add (shadows for translucent surfaces for example).&lt;br /&gt;those things result in lower fps and unrealistic scene, so i decided to create new system to overcome those problems.&lt;br /&gt;the new system manage all scene rendering using special batches, each render object need to generate those batches and feed the system, then the system manage and optimize those batches for fast rendering and lower material and stage binds.&lt;br /&gt;also the system support few render options so it will be easy and fast to render special passes such as shadows, ambient light etc.&lt;br /&gt;the good thing with this system is that it doesn't need to know about the objects being rendered, it works only on those special batches and thats it, so if i need to add new support for 3ds object for example, i just need to make sure it will generate the batches and it will automatically get all the features (shadows, lighting, post process effects etc)&lt;br /&gt;i also improved my lighting and shadowing system to support some new features:&lt;br /&gt;1. light interaction of translucent surfaces&lt;br /&gt;2. shadows for translucent surfaces, for example: glass and smoke will cast shadows depending on how translucent it is, red smoke will cast red shadows.&lt;br /&gt;next time i will upload some screenshots...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-7517460978680035972?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/7517460978680035972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=7517460978680035972' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7517460978680035972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7517460978680035972'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/10/new-render-system.html' title='New Render System'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-499663052348834414</id><published>2008-10-19T01:35:00.000-07:00</published><updated>2008-10-19T02:21:16.408-07:00</updated><title type='text'>Debug in Release</title><content type='html'>hi, this time i talk about something i "bump into" while trying to run my engine in release mode (after i changed all engine class design and such) and get a crash into my face, oops not good.&lt;br /&gt;at first i thought it something i mess with, i had no clue where to begin because the change was so big so i start shooting all over with no luck.&lt;br /&gt;so i created exception handler lib which will catch exceptions and just before it will crash it will generate two files:&lt;br /&gt;1) log file about the stack, modules, user, and the must important is the eip, which is the instruction pointer where the crash was happened.&lt;br /&gt;2) mini dump file which is generated using dbghelp.dll, this is basically a snapshot of the program before it crashed, and it can be opened via vs or windbg and it will show you the exact line that cause the crash (very useful)&lt;br /&gt;after having this kind of tool i started debugging and check what the hack cause the crash, i saw that there was uninitialized pointers such as d3ddevice interface, which wasn't make any sense because in the log i saw that textures and other data was loaded.&lt;br /&gt;this turn on the red alert, what is wrong with my code, and why it is working in debug and not in release (and it was working!!)&lt;br /&gt;i watch the engine log and see that the constructor of some managers was called twice which wasn't possible and make sens because they are singletons!! after digging a bit i notice that if you create static inline singletons (scott mayers singletongs) the compiler (which is vs2003 not 2005/2008) generating wrong code when optimization is on, and make the constructor called twice or more if you include the header in more then one object file and you call the static inline function that return the singleton instance/object.&lt;br /&gt;if you move the implementation to the .cpp code the compiler generate "good" code.&lt;br /&gt;because those managers are      heavily used i didn't want the overhead of the function calls, so i dig a little bit more and i found a trick that works.&lt;br /&gt;NOTE: this only happened on vc6 and 2003, in 2005 they fix the problem.&lt;br /&gt;so if you are used to create singletons like this:&lt;br /&gt;class CTest&lt;br /&gt;{&lt;br /&gt; public:&lt;br /&gt;  static CTest &amp;amp;GetInstance()&lt;br /&gt;  {&lt;br /&gt;   static CTest instance;&lt;br /&gt;   return instance;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;you should now use this trick:&lt;br /&gt;class CTest&lt;br /&gt;{&lt;br /&gt; public:&lt;br /&gt;  struct tDummy&lt;br /&gt;  {&lt;br /&gt;   static CTest &amp;amp;getInst()&lt;br /&gt;   {&lt;br /&gt;    static CTest instance;&lt;br /&gt;    return instance;&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;  static CTest &amp;amp;GetInstance()&lt;br /&gt;  {&lt;br /&gt;    static tDummy instance;&lt;br /&gt;    return instance.getInst();&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;vc2003 deals fine with static var which contained in a non-static inline method.&lt;br /&gt;so what i found is that i didn't mess anything and the code was fine and the compiler wasn't&lt;br /&gt;after all it was good practice to wrote the tools and i think they will be useful in the future - i hope i wont need to use them :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-499663052348834414?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/499663052348834414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=499663052348834414' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/499663052348834414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/499663052348834414'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/10/debug-in-release.html' title='Debug in Release'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-7534442228029711872</id><published>2008-10-15T08:22:00.000-07:00</published><updated>2008-10-15T09:11:22.508-07:00</updated><title type='text'>Lights And Sound Shake Data</title><content type='html'>hi, on my last posts about sounds i talked about shake data which defines the intensity of the sound at a given time/point, so i thought it will be nice to add sound to lights, but then i want the intensity of the light to be changed based on what we hear.&lt;br /&gt;for example: if we hear sound of blinking light we want the light intensity to blink and sync with that sound - this is where shake data comes in use.&lt;br /&gt;i wrote some helper function that gives me the exact shake value and i use it as scale factor when i compute the light color.&lt;br /&gt;so now i can set sounds for lights and the intensity of the light will be sync with sound shake data and gives really nice and creepy effect :)&lt;br /&gt;watch the video to see it in action:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-2a2eeafca32277b0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v6.nonxt5.googlevideo.com/videoplayback?id%3D2a2eeafca32277b0%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D24B337183FCCB2CA9CBC35AD09DCA7700141B1ED.8BD44F778208981DCED66FE1A7AD9052F74BEC6%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D2a2eeafca32277b0%26offsetms%3D5000%26itag%3Dw160%26sigh%3D0HOCOBA9domLsHtySS8usi9e-fE&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v6.nonxt5.googlevideo.com/videoplayback?id%3D2a2eeafca32277b0%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D24B337183FCCB2CA9CBC35AD09DCA7700141B1ED.8BD44F778208981DCED66FE1A7AD9052F74BEC6%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D2a2eeafca32277b0%26offsetms%3D5000%26itag%3Dw160%26sigh%3D0HOCOBA9domLsHtySS8usi9e-fE&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-7534442228029711872?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=2a2eeafca32277b0&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/7534442228029711872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=7534442228029711872' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7534442228029711872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7534442228029711872'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/10/lights-and-sound-shake-data.html' title='Lights And Sound Shake Data'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-7896418471141912406</id><published>2008-10-04T09:34:00.000-07:00</published><updated>2008-10-04T10:01:20.093-07:00</updated><title type='text'>Loading Screen</title><content type='html'>hi, this time i added loading screen feature so we see when the loading process while level data is loaded and cached.&lt;br /&gt;i also added the feature to load new maps on runtime via cvar, so i could check other maps while the core engine i initialize and cached so i wont need to stop and run the project every time i want to check other/new map.&lt;br /&gt;this was mainly an engine redesign process so everything related to level map could be released and initialized on demand.&lt;br /&gt;the loading screen i based on my gui system so its just a matter of designing the loading script and load it and update the variable and call triggers when needed.&lt;br /&gt;here is some of the code in the loading gui script:&lt;br /&gt;  windowDef p_load_bar&lt;br /&gt;  {&lt;br /&gt;      rect    235,431,( "gui::map_loading" * 405 ),26&lt;br /&gt;      visible    1&lt;br /&gt;      windowDef load_bar&lt;br /&gt;      {&lt;br /&gt;          rect    0,0,405,26&lt;br /&gt;          visible    1&lt;br /&gt;          background    "gfx/guis/mainmenu/load_bar"&lt;br /&gt;          matcolor    0.878,0.423,0,0.5&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;this window i the loading progress bar we see while we wait for the level to start, notice the 'gui::map_loading' variable in the rect definition of the window 'p_load_bar', this variable used to control the visibility of window 'load_bar'.&lt;br /&gt;because i have parent/child design, the parent window also scissor his child, that means the child windows can be visible only inside their parent rect.&lt;br /&gt;when i'm loading level/map data i'm setting this variable to the right value [0..1] and when i'm finished i'm triggering the event 'FinishedLoading' that changed the text near the loading to&lt;br /&gt;'click to continue'&lt;br /&gt;also i added script file per map, so i could define map related parameters such as the loading image. thumb image etc.&lt;br /&gt;when i need to load specific map i'm checking if the map has a script file, if so i'm getting the image that i need to load and set it as 'gui::loading_bkgnd' in the loading gui, here is the loadimg window declared inside the script:&lt;br /&gt;  windowDef loadimg&lt;br /&gt;  {&lt;br /&gt;      rect    0,0,640,480&lt;br /&gt;      visible    1&lt;br /&gt;      background    "gui::loading_bkgnd"&lt;br /&gt;      matcolor    1,1,1,1&lt;br /&gt;  }&lt;br /&gt;the window is responsible to display the loading background image.&lt;br /&gt;here is a screenshot of one of my test levels:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_GKvgMH3qkR0/SOegeynwXMI/AAAAAAAAASY/qGYt10cmVak/s1600-h/LoadingScreen_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_GKvgMH3qkR0/SOegeynwXMI/AAAAAAAAASY/qGYt10cmVak/s400/LoadingScreen_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5253343941196012738" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_GKvgMH3qkR0/SOegv1ZGYqI/AAAAAAAAASw/sGUVpyKOd2Y/s1600-h/LoadingScreen_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_GKvgMH3qkR0/SOegv1ZGYqI/AAAAAAAAASw/sGUVpyKOd2Y/s400/LoadingScreen_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5253344233997623970" border="0" /&gt;&lt;/a&gt;map doesn't have loading image&lt;br /&gt;notice the click to continue text which shown when the map finished loading&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-7896418471141912406?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/7896418471141912406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=7896418471141912406' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7896418471141912406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7896418471141912406'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/10/loading-screen.html' title='Loading Screen'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_GKvgMH3qkR0/SOegeynwXMI/AAAAAAAAASY/qGYt10cmVak/s72-c/LoadingScreen_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-6878344542919800636</id><published>2008-09-28T01:45:00.000-07:00</published><updated>2008-09-28T01:53:31.101-07:00</updated><title type='text'>Sound Occlusion Per Material</title><content type='html'>hi, i did small update to sound occlusion which defines sound occlusion properties via script file.&lt;br /&gt;so now i can define reverb and direct occlusion for each material.&lt;br /&gt;the script is very simple: (for short only 2 materials)&lt;br /&gt;none =&lt;br /&gt;{&lt;br /&gt;    "0.5",    -- directOcclusion&lt;br /&gt;    "0.5"    -- reverbOcclusion&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;stone =&lt;br /&gt;{&lt;br /&gt;    "1.0",    -- directOcclusion&lt;br /&gt;    "1.0"    -- reverbOcclusion&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;none - is the default occlusion properties if material not defined/found/exist&lt;br /&gt;the rest is direct and reverb occlusion values per material (using material name)&lt;br /&gt;when creating the sound geometry the occlusion properties will set based on material and his values from the script.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-6878344542919800636?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/6878344542919800636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=6878344542919800636' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6878344542919800636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6878344542919800636'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/09/sound-occlusion-per-material.html' title='Sound Occlusion Per Material'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-6796442460649371715</id><published>2008-09-15T02:49:00.001-07:00</published><updated>2008-09-15T03:08:12.996-07:00</updated><title type='text'>Caching Data</title><content type='html'>hi, this time i added new script file that will contain all the data that needed to be cached before the game start.&lt;br /&gt;the engine designed to load data on demand so when i'm checking things i don't need to wait until all map data will be loaded, so if for example you are not shooting at all, then the sounds and effects for the shooting wont be loaded (it will be loaded and cached when you shot at the first time)&lt;br /&gt;this is very nice and good when you are testing things but when you want to play the game this is very annoying as the game will freeze a little when you do some actions (firing/jumping etc)&lt;br /&gt;the script is very simple, it contains data to be loaded and cached per category: sounds/effects/animations.&lt;br /&gt;example for sounds category:&lt;br /&gt;SoundShaders =&lt;br /&gt;{&lt;br /&gt;"pickup_weapon"&lt;br /&gt;}&lt;br /&gt;this we cached only the "pickup_weapon" sound shader before the game start.&lt;br /&gt;for now i'm using only one cache file, but it will be extended to support few cache files - one for each map so every map will have its own data that needed to be cached before playing it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-6796442460649371715?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/6796442460649371715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=6796442460649371715' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6796442460649371715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6796442460649371715'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/09/caching-data.html' title='Caching Data'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-486076558169107594</id><published>2008-09-12T09:16:00.000-07:00</published><updated>2008-09-12T10:02:57.269-07:00</updated><title type='text'>Sound Geometry And Occlusion</title><content type='html'>hi, i added sound occlusion effect which takes scene geometry into consideration when trying to play sound with his properties.&lt;br /&gt;i created new class called CSoundGeometry which contains the geometry the sound need to consider when we are playing it.&lt;br /&gt;all sound geometry classes separated by material properties so i can give different sound occlusion and reverberation properties based on the material.&lt;br /&gt;for example: stone will occlude more sound then glass.&lt;br /&gt;for now i didn't setup the properties table for each material, so every material will block the sound in 100% (so no reverberation for now).&lt;br /&gt;i added debug rendering for the sounds so i know when sound is occlude and how much by rendering red to green color circle interpolated from the min to max distance property of the sound, so if the sound have 10 to 100 (min, max distance) and it is occluded it is shown in red, if not it is shown in green, if it is 50% occluded it is shown a circle radius of 45 and with 50% color between red and green.&lt;br /&gt;note that only one room has sound in it so only when the door is opened we can hear it, you can also hear the steps sound and gear when you are moving.&lt;br /&gt;the door also have few sounds for few states: open/opened/closes/locked&lt;br /&gt;here is screenshots and short movie that shows sound occlusion in action.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_GKvgMH3qkR0/SMqghHkQ2JI/AAAAAAAAASI/RpeIrepWRDo/s1600-h/SoundOcclusion_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_GKvgMH3qkR0/SMqghHkQ2JI/AAAAAAAAASI/RpeIrepWRDo/s400/SoundOcclusion_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5245181206853638290" border="0" /&gt;&lt;/a&gt;&lt;div style="text-align: center;"&gt;sounds shown in green spheres, occluded sounds in red&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_GKvgMH3qkR0/SMqghMcQvUI/AAAAAAAAASQ/0WKQBlC9xJM/s1600-h/SoundOcclusion_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_GKvgMH3qkR0/SMqghMcQvUI/AAAAAAAAASQ/0WKQBlC9xJM/s400/SoundOcclusion_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5245181208162254146" border="0" /&gt;&lt;/a&gt;min/max distances of sounds shown in green circles, occluded sounds in red&lt;br /&gt;the door is opened at 50% so the top sound is occluded 50% meaning 50% between red to green&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-c65a05624e26ceaa" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v4.nonxt1.googlevideo.com/videoplayback?id%3Dc65a05624e26ceaa%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D2914B93A0584B2D4EE1C0B237F3A5306367194A0.F44DE0DDE0A2D7EF834AAECE6CE2F42904FB6CC%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Dc65a05624e26ceaa%26offsetms%3D5000%26itag%3Dw160%26sigh%3Dg8m25A92tVhWe5ug8hRrVha2UhA&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v4.nonxt1.googlevideo.com/videoplayback?id%3Dc65a05624e26ceaa%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D2914B93A0584B2D4EE1C0B237F3A5306367194A0.F44DE0DDE0A2D7EF834AAECE6CE2F42904FB6CC%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Dc65a05624e26ceaa%26offsetms%3D5000%26itag%3Dw160%26sigh%3Dg8m25A92tVhWe5ug8hRrVha2UhA&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-486076558169107594?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=c65a05624e26ceaa&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/486076558169107594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=486076558169107594' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/486076558169107594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/486076558169107594'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/09/sound-geometry-and-occlusion.html' title='Sound Geometry And Occlusion'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_GKvgMH3qkR0/SMqghHkQ2JI/AAAAAAAAASI/RpeIrepWRDo/s72-c/SoundOcclusion_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-8552934799541414239</id><published>2008-09-12T08:41:00.000-07:00</published><updated>2008-09-12T08:55:47.456-07:00</updated><title type='text'>Light Leaks</title><content type='html'>hi, small update about something i saw while working on sound occlusion.&lt;br /&gt;i created small level containing 2 rooms with a door separating them, while playing with this level i saw some lights leaks near the door and at the sides of one of the rooms room (the one without a light) it appears that some of the light from the lighten room leaked into the dark room - very strange, because i'm using vsm for shadowing the scene and i'm using some thresholds to solve the light bleeding problem i thought to give a second check to this threshold.&lt;br /&gt;so what i did is increasing the light bleeding threshold and everything look good now :)&lt;br /&gt;here is few screenshots showing the problem before and after solving it:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_GKvgMH3qkR0/SMqQMi7uKqI/AAAAAAAAARY/fQ213hluh-U/s1600-h/LightLeaks_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_GKvgMH3qkR0/SMqQMi7uKqI/AAAAAAAAARY/fQ213hluh-U/s400/LightLeaks_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5245163261236488866" border="0" /&gt;&lt;/a&gt;close door - leaks on sides and near door&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_GKvgMH3qkR0/SMqQMndjzfI/AAAAAAAAARg/j7FXeSEVVKM/s1600-h/LightLeaks_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_GKvgMH3qkR0/SMqQMndjzfI/AAAAAAAAARg/j7FXeSEVVKM/s400/LightLeaks_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5245163262452157938" border="0" /&gt;&lt;/a&gt;open door - leaks on sides&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_GKvgMH3qkR0/SMqQM4rz0rI/AAAAAAAAARo/FTdKRAK6atA/s1600-h/LightLeaks_2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_GKvgMH3qkR0/SMqQM4rz0rI/AAAAAAAAARo/FTdKRAK6atA/s400/LightLeaks_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5245163267075330738" border="0" /&gt;&lt;/a&gt;close door - no leaks&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_GKvgMH3qkR0/SMqQM6QscDI/AAAAAAAAARw/W9N858Ey7B8/s1600-h/LightLeaks_3.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_GKvgMH3qkR0/SMqQM6QscDI/AAAAAAAAARw/W9N858Ey7B8/s400/LightLeaks_3.jpg" alt="" id="BLOGGER_PHOTO_ID_5245163267498471474" border="0" /&gt;&lt;/a&gt;open door - no leaks&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-8552934799541414239?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/8552934799541414239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=8552934799541414239' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8552934799541414239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8552934799541414239'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/09/light-leaks.html' title='Light Leaks'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_GKvgMH3qkR0/SMqQMi7uKqI/AAAAAAAAARY/fQ213hluh-U/s72-c/LightLeaks_0.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-4775617058490995371</id><published>2008-09-07T02:43:00.001-07:00</published><updated>2008-09-07T03:16:38.938-07:00</updated><title type='text'>Ambience Sounds</title><content type='html'>hi, this week i added ambience sounds, so i could place sounds in the scene which will be played based on their properties defined in the map file.&lt;br /&gt;unlike other sounds, those sounds usually played automatically (some ambient creepy sounds), or by triggering some triggers/events (like opening a door, or using an elevator)&lt;br /&gt;here is an example of sound entity defined in the map:&lt;br /&gt;{&lt;br /&gt;"origin" "753.48 2078.26 66.7"&lt;br /&gt;"classname" "speaker"&lt;br /&gt;"angle" "315.181274"&lt;br /&gt;"s_shader" "sound/ambience/music.ogg"&lt;br /&gt;"s_looping" "1"&lt;br /&gt;"s_shakes" "0.000000"&lt;br /&gt;"name" "speaker_2"&lt;br /&gt;"s_volume" "-6.000000"&lt;br /&gt;"s_mindistance" "512.000000"&lt;br /&gt;"s_maxdistance" "1200.000000"&lt;br /&gt;"s_occlusion" "0"&lt;br /&gt;"s_waitfortrigger" "0"&lt;br /&gt;"soundgroup" ""&lt;br /&gt;"wait" "0.000000"&lt;br /&gt;"random" "0.000000"&lt;br /&gt;"s_global" "0"&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ok, so what are all those properties do? here is a quick info:&lt;br /&gt;origin - the position in 3d space of the sound (if ambient this will be ignored)&lt;br /&gt;classname - internal use, basically its the type of the entity&lt;br /&gt;angle - control the spread of the sound&lt;br /&gt;s_shader - sound shader or sound media file (.wav, .ogg, .mp3)&lt;br /&gt;s_looping - need to loop or not (repeat the sound over and over)&lt;br /&gt;s_shakes - shake factor controlling how strong the view will be shake when playing the sound (also based on the loudness of the sound)&lt;br /&gt;name - name of the sound/speaker entity&lt;br /&gt;s_volume - volume of sound (in decibels)&lt;br /&gt;s_mindistance, s_maxdistance - minimum and maximum audible distance for the sound&lt;br /&gt;s_occlusion - is this sound need to take care of geometry occlusion or not&lt;br /&gt;s_waitfortrigger - sound will be played only when the right trigger will be triggered&lt;br /&gt;soundgroup - the group the sound belongs to, useful for setting volume for few sounds, for example, all music sounds added to group "music" so if we want to mute the music in the game we just mute the group called "musics" and its done.&lt;br /&gt;wait - delay between playing the sound again&lt;br /&gt;random - random factor added to wait when needing to play the sound again&lt;br /&gt;s_global - is this sound need to be heard every where (makes the sound ambient - used for music), if its ambient the sound will ignore his 3d properties.&lt;br /&gt;so as you can see it is very easy to define ambient sounds in the scene, those sounds adding alot to the game play and make the game more realistic.&lt;br /&gt;for now, geometry occlusion is not supported maybe i will add it next time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-4775617058490995371?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/4775617058490995371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=4775617058490995371' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4775617058490995371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4775617058490995371'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/09/ambience-sounds.html' title='Ambience Sounds'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-4343733331759392330</id><published>2008-08-30T10:42:00.001-07:00</published><updated>2008-08-30T11:17:23.302-07:00</updated><title type='text'>Convex Decomposition</title><content type='html'>hi, this time i fixed my physics objects support so i could add more complicated objects to the scene not just box, sphere etc, but also concave models.&lt;br /&gt;physx does not support dynamic concave objects but it support multiple collision shape per obj so in order to support concave objects we must do something called: convex decomposition which break down or split the mesh into few convex meshes.&lt;br /&gt;the data is stored in xml file which include all the info to create the convex mesh shapes that describe to render model.&lt;br /&gt;i created new function in the physics manager that creates physics obj directly from this xml file, also i add the ability to specify collision script file (this xml) to every render model exist in the scene.&lt;br /&gt;to work with xml files i use tinyXml which is very small and easy to use.&lt;br /&gt;here is few screenshots that shows perfect collision with concave objects:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_GKvgMH3qkR0/SLmNh5V6AeI/AAAAAAAAARI/IE6-ZDGrjLM/s1600-h/ConcaveObj_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_GKvgMH3qkR0/SLmNh5V6AeI/AAAAAAAAARI/IE6-ZDGrjLM/s400/ConcaveObj_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5240375254890185186" border="0" /&gt;&lt;/a&gt;tables lies on the inner part of other tables&lt;br /&gt;note the left table edge placed on the right table&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_GKvgMH3qkR0/SLmNiGTiWqI/AAAAAAAAARQ/Lh5cnDmWaAc/s1600-h/ConcaveObj_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_GKvgMH3qkR0/SLmNiGTiWqI/AAAAAAAAARQ/Lh5cnDmWaAc/s400/ConcaveObj_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5240375258369907362" border="0" /&gt;&lt;/a&gt;tables placed on the inner parts of other tables&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-4343733331759392330?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/4343733331759392330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=4343733331759392330' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4343733331759392330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4343733331759392330'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/08/convex-decomposition.html' title='Convex Decomposition'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_GKvgMH3qkR0/SLmNh5V6AeI/AAAAAAAAARI/IE6-ZDGrjLM/s72-c/ConcaveObj_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-18307341770890481</id><published>2008-08-23T10:35:00.000-07:00</published><updated>2008-08-24T00:35:09.015-07:00</updated><title type='text'>Sound Manager</title><content type='html'>hi, this time i worked on the sound system, there is a lot of sound libs such as openal, bass, fmod, miles.&lt;br /&gt;i chosed to use fmod ex because it is very advanced system and very easy to use.&lt;br /&gt;i created sound manager to manage all sound creation in the game, i also add something called sound shader which is very similar to my material script.&lt;br /&gt;sound shader is a script that let you to define specific parameters to one or few sounds and when you want to play the sound/s in that shader you just call CreateSoundFromShader(shaderNameInScript) which is a function inside sound manager and it will be played with all the attributes you specified in the script.&lt;br /&gt;for example:&lt;br /&gt;sound weapon_blaster_fire&lt;br /&gt;{&lt;br /&gt;   minDistance    393&lt;br /&gt;   maxDistance    1181&lt;br /&gt;   volumeDb    -2&lt;br /&gt;   frequentlyused&lt;br /&gt;&lt;br /&gt;   sound/weapons/blaster/fire01&lt;br /&gt;   shakeData 0 zzzztsolggeedccbbbaaaaaaaa&lt;br /&gt;   sound/weapons/blaster/fire02&lt;br /&gt;   shakeData 1 zzzztsolggeedccbbbaaaaaaaa&lt;br /&gt;}&lt;br /&gt;1) weapon_blaster_fire is sound shader name which we called from the code&lt;br /&gt;min/max distance is the distance which the sound is audible&lt;br /&gt;2) volumeDb is volume in decibels&lt;br /&gt;3) frequentlyused is one of few flags that allow me to control few sound attributes such as occlusion, looping etc. this is used to cache the sound so it will be played from memory and wont be decompressed every time we want to play it&lt;br /&gt;4) sound/weapons/blaster/fire01 and sound/weapons/blaster/fire02 is 2 sound files we wish to play while activating this sound shader. by default we chose randomly one of them.&lt;br /&gt;5) shakeData is intensity of the sound in ascii form (z is loud, a is complete silence), i use it to change camera view based on the sound volume.&lt;br /&gt;few of the sounds in the game must be played in relation to model animations, so to make it possible i created something called frame based event system, which allows you to specify events that will be triggered on specific animation frame/s.&lt;br /&gt;for example, this is how i created shotgun reload sound events:&lt;br /&gt;VIEW_RELOAD_CMD        =&lt;br /&gt;{  &lt;br /&gt;   "RELOAD", "9", "sound", "weapon_shotgun_clipout",&lt;br /&gt;   "RELOAD", "22", "sound", "weapon_shotgun_clipin",&lt;br /&gt;   "RELOAD", "35", "sound", "weapon_shotgun_pump1",&lt;br /&gt;   "RELOAD", "38", "sound", "weapon_shotgun_pump2"&lt;br /&gt;}&lt;br /&gt;"RELOAD" is animation name&lt;br /&gt;"9", "22", "35", "38" is frames to trigger the event&lt;br /&gt;"sound" event type - all of them is sound&lt;br /&gt;the last parameter is based on event type, in sound events its sound shader name&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-18307341770890481?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/18307341770890481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=18307341770890481' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/18307341770890481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/18307341770890481'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/08/sound-manager.html' title='Sound Manager'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-1127015531940227437</id><published>2008-08-16T05:43:00.000-07:00</published><updated>2008-08-16T05:56:40.986-07:00</updated><title type='text'>Material Hit Effect</title><content type='html'>hi, this week i fix my projectiles hit effects so they support per surface material effect,&lt;br /&gt;until now, i had only one impact effect per projectile for all surface types, this was very unnatural when you hit water surface because it was applied the same effect on it, so you saw decal rendered on the water, yes - very strange so now if you hit glass surface the effect will be different when you hit stone or liquid surfaces, depending on what you defined in the weapon script.&lt;br /&gt;here is a screenshot that shows the effect on stone, glass surfaces:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_GKvgMH3qkR0/SKbNIjsKrQI/AAAAAAAAARA/WX0ZtjYC9us/s1600-h/MaterialHitEffect_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_GKvgMH3qkR0/SKbNIjsKrQI/AAAAAAAAARA/WX0ZtjYC9us/s400/MaterialHitEffect_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5235097163767917826" border="0" /&gt;&lt;/a&gt;left: stone hits, right: glass hits&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-1127015531940227437?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/1127015531940227437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=1127015531940227437' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/1127015531940227437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/1127015531940227437'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/08/material-hit-effect.html' title='Material Hit Effect'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_GKvgMH3qkR0/SKbNIjsKrQI/AAAAAAAAARA/WX0ZtjYC9us/s72-c/MaterialHitEffect_0.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-6593977827103653262</id><published>2008-08-02T04:19:00.000-07:00</published><updated>2008-08-02T05:31:23.313-07:00</updated><title type='text'>Weapons Sniper  Scope</title><content type='html'>hi, i'm still working on weapons features, this time i added sniper scope with nice radial blur effect.&lt;br /&gt;to create this radial effect i needed to add few features to material system so i could define which shader to use in which stage and which shader parameters and samplers i need to bind when binding this shader.&lt;br /&gt;i also add the option to use current back buffer image as one of the samplers i'm binding to the shader, so i could create post process effects.&lt;br /&gt;the effect i chosed is radial blur so everything outside our zoom area will be blurred and stretched.&lt;br /&gt;i also change aim accuracy based on zoom, the more we zoom in the more we get accurate.&lt;br /&gt;here is screenshots of the effect.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_GKvgMH3qkR0/SJRO8e8SZbI/AAAAAAAAAQ4/q_wc659glTE/s1600-h/SniperScope_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_GKvgMH3qkR0/SJRO8e8SZbI/AAAAAAAAAQ4/q_wc659glTE/s400/SniperScope_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5229891868289033650" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-6593977827103653262?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/6593977827103653262/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=6593977827103653262' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6593977827103653262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6593977827103653262'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/08/weapons-sniper-scope.html' title='Weapons Sniper  Scope'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_GKvgMH3qkR0/SJRO8e8SZbI/AAAAAAAAAQ4/q_wc659glTE/s72-c/SniperScope_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-8361898106430814512</id><published>2008-07-23T07:11:00.000-07:00</published><updated>2008-07-23T07:29:53.180-07:00</updated><title type='text'>Weapon Sight and Lock mode</title><content type='html'>hi&lt;br /&gt;i worked on some game play features that allows you to control your weapon more easy.&lt;br /&gt;1. adding weapon sight on the screen so you know where you are aiming at also when you are aiming on game entity (for now bots) you will see the name of the bot and the distance near your sight icon.&lt;br /&gt;note that each weapon have its own sight icon.&lt;br /&gt;2. weapon lock mode, allows you to lock your weapon to your shoulder, and set your view with weapon sight for more accurate aiming, also it increase weapon accuracy while shoting.&lt;br /&gt;here his few screenshots:&lt;br /&gt;note: hud removed from those sceenshots.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_GKvgMH3qkR0/SIc_0CHm4QI/AAAAAAAAAQo/2qhL-Yd9_pU/s1600-h/WepLockMode_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_GKvgMH3qkR0/SIc_0CHm4QI/AAAAAAAAAQo/2qhL-Yd9_pU/s400/WepLockMode_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5226216055741276418" border="0" /&gt;&lt;/a&gt;bot name and distance&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/SIc_0deYW2I/AAAAAAAAAQw/Rp88y19r7wE/s1600-h/WepLockMode_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/SIc_0deYW2I/AAAAAAAAAQw/Rp88y19r7wE/s400/WepLockMode_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5226216063084551010" border="0" /&gt;&lt;/a&gt;lock mode active&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-8361898106430814512?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/8361898106430814512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=8361898106430814512' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8361898106430814512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8361898106430814512'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/07/weapon-sight-and-lock-mode.html' title='Weapon Sight and Lock mode'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_GKvgMH3qkR0/SIc_0CHm4QI/AAAAAAAAAQo/2qhL-Yd9_pU/s72-c/WepLockMode_0.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-8550524547744090531</id><published>2008-07-14T02:28:00.001-07:00</published><updated>2008-07-14T02:38:47.588-07:00</updated><title type='text'>SSAO Integration</title><content type='html'>hi&lt;br /&gt;last time i was playing with SSAO effect inside render monkey, after i was pleased with the results i started to integrate it into my engine.&lt;br /&gt;it was very easy to integrate it because my flexible material system, the only thing i needed to do is to scale the parameters to fit my scene scale.&lt;br /&gt;i still think there is few tiny things to fix (i don't know if i would fix them), but still it adds very nice global illumination effect :)&lt;br /&gt;here is few screenshots:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/SHsd4khDPwI/AAAAAAAAAQQ/oN8jsmG8Qm4/s1600-h/SSAO_0.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/SHsd4khDPwI/AAAAAAAAAQQ/oN8jsmG8Qm4/s400/SSAO_0.JPG" alt="" id="BLOGGER_PHOTO_ID_5222801050578403074" border="0" /&gt;&lt;/a&gt;shadows without ssao&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/SHsd4p2rKgI/AAAAAAAAAQY/Se1Ob0UW4jE/s1600-h/SSAO_1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/SHsd4p2rKgI/AAAAAAAAAQY/Se1Ob0UW4jE/s400/SSAO_1.JPG" alt="" id="BLOGGER_PHOTO_ID_5222801052011276802" border="0" /&gt;&lt;/a&gt;shadows with ssao&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/SHsd42TeEUI/AAAAAAAAAQg/cni0CNwNdhc/s1600-h/SSAO_2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/SHsd42TeEUI/AAAAAAAAAQg/cni0CNwNdhc/s400/SSAO_2.JPG" alt="" id="BLOGGER_PHOTO_ID_5222801055353278786" border="0" /&gt;&lt;/a&gt;ssao texture at top left corner&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-8550524547744090531?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/8550524547744090531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=8550524547744090531' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8550524547744090531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8550524547744090531'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/07/ssao-integration.html' title='SSAO Integration'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_GKvgMH3qkR0/SHsd4khDPwI/AAAAAAAAAQQ/oN8jsmG8Qm4/s72-c/SSAO_0.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-6605211307139062122</id><published>2008-07-11T08:08:00.000-07:00</published><updated>2008-07-11T08:35:44.179-07:00</updated><title type='text'>Screen Space Ambient Occlusion (SSAO)</title><content type='html'>hi, since the game crysis (by crytek) every talks about it, so i thought to give it a try :)&lt;br /&gt;ambient occlusion is a global shading method that computes how much a certain point need to be illuminated based on the surrounding objects.&lt;br /&gt;in computer graphics we can calculated this by taking specific point in space and cast x rays in random directions from that point and for every ray hit we check add or subtract "illumination value" from that point based on the closeness of the object the ray hit.&lt;br /&gt;the closest the surface we hit, the point will be less illuminated, so if we have a point in space surrounded by alot of objects the point will be darken while other point that does not have a lot of objects around will be lighten.&lt;br /&gt;ssao approximate this by using the depth buffer, for every pixel we check/sample few pixels around and try to compute the amount of occlusion from those points based on the difference in the depth of the current pixel and the pixels around, this technique has a lot of tiny things to set up before you could make it looks good, because of that i'v chosen to use ati render monkey application to create and test my shaders.&lt;br /&gt;i'm glade to say the after one day and a half i got it, and it looks very good.&lt;br /&gt;here is a screenshot from my results:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_GKvgMH3qkR0/SHd9r5qfzPI/AAAAAAAAAQA/tCJwQhR9r-o/s1600-h/RenderMoney_SSAO_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_GKvgMH3qkR0/SHd9r5qfzPI/AAAAAAAAAQA/tCJwQhR9r-o/s400/RenderMoney_SSAO_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5221780486126292210" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/SHd9r3xijiI/AAAAAAAAAQI/UnrmeicsMpk/s1600-h/RenderMoney_SSAO_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/SHd9r3xijiI/AAAAAAAAAQI/UnrmeicsMpk/s400/RenderMoney_SSAO_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5221780485618961954" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-6605211307139062122?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/6605211307139062122/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=6605211307139062122' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6605211307139062122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6605211307139062122'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/07/screen-space-ambient-occlusion-ssao.html' title='Screen Space Ambient Occlusion (SSAO)'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_GKvgMH3qkR0/SHd9r5qfzPI/AAAAAAAAAQA/tCJwQhR9r-o/s72-c/RenderMoney_SSAO_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-6493504436001575923</id><published>2008-06-28T08:55:00.001-07:00</published><updated>2008-06-28T09:11:13.821-07:00</updated><title type='text'>Physics in Action</title><content type='html'>hi&lt;br /&gt;with the new physics engine and ragdoll i added damage system, so if you hit the head you will damage the bot a lot more if you hit the leg or arm.&lt;br /&gt;also if the bot kills you the camera change from first to third person mode so you could see ragdoll physics in action when you fall on the ground.&lt;br /&gt;few bugs here and there but the new system is really cool :)&lt;br /&gt;few videos that shows the new physics engine in action:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-63c4fa79b52381b9" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v22.nonxt7.googlevideo.com/videoplayback?id%3D63c4fa79b52381b9%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D2DBC9E1C5887C206EF57A672A277659B844C909A.2A41FB6078AE78DFEF0B426DAED60FF0B387E5D0%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D63c4fa79b52381b9%26offsetms%3D5000%26itag%3Dw160%26sigh%3D6CbKVnA7S4hrm61i841P2TME1b0&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v22.nonxt7.googlevideo.com/videoplayback?id%3D63c4fa79b52381b9%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D2DBC9E1C5887C206EF57A672A277659B844C909A.2A41FB6078AE78DFEF0B426DAED60FF0B387E5D0%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D63c4fa79b52381b9%26offsetms%3D5000%26itag%3Dw160%26sigh%3D6CbKVnA7S4hrm61i841P2TME1b0&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-6ba1f63a77f764b8" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v4.nonxt7.googlevideo.com/videoplayback?id%3D6ba1f63a77f764b8%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3DCBB67DE25CEC6D686C8E1CE37CEEE6566C311AD.2FC38A3C1A332867AB1F97756F3948DC36D6BA6F%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D6ba1f63a77f764b8%26offsetms%3D5000%26itag%3Dw160%26sigh%3DB0A3Wao0lpUBtVcdf2-1SpJSCZY&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v4.nonxt7.googlevideo.com/videoplayback?id%3D6ba1f63a77f764b8%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3DCBB67DE25CEC6D686C8E1CE37CEEE6566C311AD.2FC38A3C1A332867AB1F97756F3948DC36D6BA6F%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D6ba1f63a77f764b8%26offsetms%3D5000%26itag%3Dw160%26sigh%3DB0A3Wao0lpUBtVcdf2-1SpJSCZY&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-6493504436001575923?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=63c4fa79b52381b9&amp;type=video%2Fmp4' length='0'/><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=6ba1f63a77f764b8&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/6493504436001575923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=6493504436001575923' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6493504436001575923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6493504436001575923'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/06/physics-in-action.html' title='Physics in Action'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-9065686585444094738</id><published>2008-06-19T01:35:00.000-07:00</published><updated>2008-06-19T01:57:43.081-07:00</updated><title type='text'>NVidia PhysX Integration</title><content type='html'>hi&lt;br /&gt;while trying to create advanced ragdoll physics i found that my physics engine isn't so stable.&lt;br /&gt;for example: if i throw ragdoll from high place to the ground, it could get very unstable due to my simple solver.&lt;br /&gt;as you all know, nvidia acquired ageia physx and they also have 2 new cards geforce 260/280 thats have build in physics accelerator. (based on ageia physx technologies)&lt;br /&gt;i think is great solution, buying one card that support graphics and physics is cool.&lt;br /&gt;the solution to my physics problems was very simple:&lt;br /&gt;1. i could spend few more weeks to fix and some few other things on the way&lt;br /&gt;2. integrate some of the commercial physics libs. (havok/physx)&lt;br /&gt;i decided that it is best to go with option 2.&lt;br /&gt;another question was havok or physx? i decided to go with physx as it is very understandable, easy and have tons of samples.&lt;br /&gt;the integration went very smooth, i change my physics manager to support their function and the ragdoll is very stable now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-9065686585444094738?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/9065686585444094738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=9065686585444094738' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/9065686585444094738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/9065686585444094738'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/06/nvidia-physx-integration.html' title='NVidia PhysX Integration'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-600682412059973534</id><published>2008-05-31T10:28:00.000-07:00</published><updated>2008-06-01T01:11:40.795-07:00</updated><title type='text'>Ragdoll Physics</title><content type='html'>hi, long time without updates...&lt;br /&gt;while shooting and killing bots i notice that something isn't right, something is missing - die animation or something like that.&lt;br /&gt;so to fix that i thought i to create some new animation sets but that isn't perfect, so i decided to add ragdoll physics which have some drawbacks but is better then animation sets.&lt;br /&gt;i added new script file like id does (.af files) which defines the physics bodies and properties also constraints between those bodies.&lt;br /&gt;i also add new class that will read and manage the info and create the physics model from it.&lt;br /&gt;after that i created two main functions:&lt;br /&gt;1. setup physics bodies from current animation set - this is very useful function because you don't have to care about model pose and how to set physics from it, you just call this function and it will set the physics bodies to match current model animation.&lt;br /&gt;2. set animation set from physics pose - used to alter model skeleton so everything applied to the physics bodies will change the visual model.&lt;br /&gt;NOTE: when i setup physics bodies from skeleton i use T pose so it will be easy to setup physics bodies and constraints.&lt;br /&gt;here is screenshot of ragdoll setup using T pose (red/green spheres is constraints)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_GKvgMH3qkR0/SEGQQ6YvFjI/AAAAAAAAAP4/GHQjHP1lplo/s1600-h/Ragdoll_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_GKvgMH3qkR0/SEGQQ6YvFjI/AAAAAAAAAP4/GHQjHP1lplo/s400/Ragdoll_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5206601264442316338" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-600682412059973534?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/600682412059973534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=600682412059973534' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/600682412059973534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/600682412059973534'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/05/ragdoll-physics.html' title='Ragdoll Physics'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_GKvgMH3qkR0/SEGQQ6YvFjI/AAAAAAAAAP4/GHQjHP1lplo/s72-c/Ragdoll_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-4321190884800146588</id><published>2008-04-26T09:12:00.000-07:00</published><updated>2008-04-26T09:38:41.577-07:00</updated><title type='text'>Jumping, Climbing, Crouching in Action</title><content type='html'>hi, as i promised from the last post, here is movie that shows the bot in action using the new areas features (showing crouching and jumping)&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-95d86f8efda19362" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v3.nonxt1.googlevideo.com/videoplayback?id%3D95d86f8efda19362%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D6A86946AE7D076A560EEE965BF0C1FD921C26287.102C20BECD18FBDA5C97899587E780FE8E692C02%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D95d86f8efda19362%26offsetms%3D5000%26itag%3Dw160%26sigh%3Dx63jc35t_8JvtQ295iozRXJPPFE&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v3.nonxt1.googlevideo.com/videoplayback?id%3D95d86f8efda19362%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D6A86946AE7D076A560EEE965BF0C1FD921C26287.102C20BECD18FBDA5C97899587E780FE8E692C02%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D95d86f8efda19362%26offsetms%3D5000%26itag%3Dw160%26sigh%3Dx63jc35t_8JvtQ295iozRXJPPFE&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;i also add the ability of climbing and crouching to the player.&lt;br /&gt;note that the bot can also climb a ladder, i'm not showing it in the video because i dont have climbing animation and it looks like flying on it and not climbing.&lt;br /&gt;also nice feature i added to collision system is the ability to know which type of material i collided with so for example: if a bolt hit a stone it will leave different mark if it hits liquid.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-4321190884800146588?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=95d86f8efda19362&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/4321190884800146588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=4321190884800146588' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4321190884800146588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4321190884800146588'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/04/jumping-climbing-crouching-in-action.html' title='Jumping, Climbing, Crouching in Action'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-6654476698043448743</id><published>2008-04-22T09:53:00.000-07:00</published><updated>2008-04-22T10:06:07.701-07:00</updated><title type='text'>Jumping, Climbing, Crouching and more</title><content type='html'>hi&lt;br /&gt;this is holidays time so i had some time to dig into some cool AI stuff, basically i added the ability to edit AI data in run-time with a mini AI editor.&lt;br /&gt;what this means is that i can add special features between areas such as, jumping, climbing a ladder, teleporting etc.&lt;br /&gt;here is a screen shot of the mini editing tool:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_GKvgMH3qkR0/SA4aKtapeKI/AAAAAAAAAPw/ZR2S_D9Thwk/s1600-h/ReachabilitiesEditor_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_GKvgMH3qkR0/SA4aKtapeKI/AAAAAAAAAPw/ZR2S_D9Thwk/s400/ReachabilitiesEditor_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5192116191697139874" border="0" /&gt;&lt;/a&gt;1. the red/green spheres on the edge is the start/end points of the jump feature&lt;br /&gt;2. the right side shows me which features the area the mouse on support, this is marked by the floating green sphere.&lt;br /&gt;few keys to do some basic stuff such as set start/end points, set current feature, reset and save the data.&lt;br /&gt;next time i will upload movie that shows the bot in action.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-6654476698043448743?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/6654476698043448743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=6654476698043448743' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6654476698043448743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6654476698043448743'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/04/jumping-climbing-crouching-and-more.html' title='Jumping, Climbing, Crouching and more'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_GKvgMH3qkR0/SA4aKtapeKI/AAAAAAAAAPw/ZR2S_D9Thwk/s72-c/ReachabilitiesEditor_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-6597252221494083458</id><published>2008-04-05T10:50:00.000-07:00</published><updated>2008-04-05T10:56:59.429-07:00</updated><title type='text'>Console</title><content type='html'>hi, another post this weekend.&lt;br /&gt;this time is the console, allows me to change engine variables (cvars) at runtime, such as AI params, renderer params etc.&lt;br /&gt;support auto complete, history, keyboard and mouse wheel scrolling, not much to say - just a console.&lt;br /&gt;here is a screenshot:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_GKvgMH3qkR0/R_e9Gf_rdzI/AAAAAAAAAPg/Rp03l0OTM3E/s1600-h/Console_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_GKvgMH3qkR0/R_e9Gf_rdzI/AAAAAAAAAPg/Rp03l0OTM3E/s400/Console_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5185821415305869106" border="0" /&gt;&lt;/a&gt;before execute shadowmapblur=1&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_GKvgMH3qkR0/R_e9G__rd0I/AAAAAAAAAPo/7v8F-7UdupA/s1600-h/Console_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_GKvgMH3qkR0/R_e9G__rd0I/AAAAAAAAAPo/7v8F-7UdupA/s400/Console_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5185821423895803714" border="0" /&gt;&lt;/a&gt;after before execute shadowmapblur=1&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-6597252221494083458?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/6597252221494083458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=6597252221494083458' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6597252221494083458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6597252221494083458'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/04/console.html' title='Console'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_GKvgMH3qkR0/R_e9Gf_rdzI/AAAAAAAAAPg/Rp03l0OTM3E/s72-c/Console_0.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-4898558488291398961</id><published>2008-04-05T10:40:00.000-07:00</published><updated>2008-04-06T01:39:48.901-07:00</updated><title type='text'>Profiler Improvement</title><content type='html'>hi, this weekend i improve my profiler.&lt;br /&gt;i have simple profiling that let me mark places in the code with PROFILER_BEGIN/END commands and then it shows me the results in a tree view.&lt;br /&gt;while trying to profile some area in the renderer i found a bug in the timing, i cast the time value to dword while i should not.&lt;br /&gt;i also added the feature which mark in red the worst time node in the tree and in orange the worst time leaf in the tree, this way i can see very clearly where the optimization needs to be.&lt;br /&gt;one area i know for sure that needs to be optimize is make skinning. so here is a screenshot of the profiler shows you the results.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_GKvgMH3qkR0/R_e7yP_rdyI/AAAAAAAAAPY/Kbysut7Mljc/s1600-h/Profiler_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_GKvgMH3qkR0/R_e7yP_rdyI/AAAAAAAAAPY/Kbysut7Mljc/s400/Profiler_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5185819967901890338" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-4898558488291398961?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/4898558488291398961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=4898558488291398961' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4898558488291398961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4898558488291398961'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/04/profiler-improvement.html' title='Profiler Improvement'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_GKvgMH3qkR0/R_e7yP_rdyI/AAAAAAAAAPY/Kbysut7Mljc/s72-c/Profiler_0.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-4740154461017911633</id><published>2008-03-23T10:37:00.000-07:00</published><updated>2008-03-24T01:31:23.927-07:00</updated><title type='text'>Dynamic Obstacle Avodance Integration</title><content type='html'>hi, this task wasn't easy, a lot of tiny things that needed to be fix - as i said in my last post :)&lt;br /&gt;but now i'm very pleased with the result, i can drop any number of dynamic obstacles in the scene and the bot/entity will navigate around them.&lt;br /&gt;one very important thing is to make your bot move smoothly and try to take shortcuts when possible, if you wont do it your bot will move around obstacles edges while you can see for sure he can take shortcut, this will make him looks very unnatural and robotic.&lt;br /&gt;here is some screenshots that shows the system in action:&lt;br /&gt;NOTES:&lt;br /&gt;* purple lines shows the from the precomputed ai data the bot aware of, this is convex area so  the bot knows he can walk in straight line to any other point in that area.&lt;br /&gt;* small green sphere, goal position the bot need to be at the end&lt;br /&gt;* medium green sphere is the point the bot will move to on the path resulting from dynamic   obstacles system, this point is the result of path smoothing. the yellow lines is the path around obstacles without smoothing.&lt;br /&gt;* white boxes is dynamic obstacles (dynamic rigid bodies in debug mode), the green lines around them is the expanding edges of their box.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/R-aaQ__rdtI/AAAAAAAAAOw/KFBWEViC2Ps/s1600-h/DynamicObstacles_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/R-aaQ__rdtI/AAAAAAAAAOw/KFBWEViC2Ps/s400/DynamicObstacles_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5180998038183442130" border="0" /&gt;&lt;/a&gt;Simple scene (1 area) this is what the bot aware of&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_GKvgMH3qkR0/R-aaRP_rduI/AAAAAAAAAO4/hUWKbVki6fA/s1600-h/DynamicObstacles_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_GKvgMH3qkR0/R-aaRP_rduI/AAAAAAAAAO4/hUWKbVki6fA/s400/DynamicObstacles_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5180998042478409442" border="0" /&gt;&lt;/a&gt;One obstacle added and path generated from the system&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_GKvgMH3qkR0/R-aaRv_rdvI/AAAAAAAAAPA/GLl_BO-dkd8/s1600-h/DynamicObstacles_2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_GKvgMH3qkR0/R-aaRv_rdvI/AAAAAAAAAPA/GLl_BO-dkd8/s400/DynamicObstacles_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5180998051068344050" border="0" /&gt;&lt;/a&gt;Few more added and you can see the new path generated&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_GKvgMH3qkR0/R-aaRv_rdwI/AAAAAAAAAPI/P8oRQ2zjDg0/s1600-h/DynamicObstacles_3.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_GKvgMH3qkR0/R-aaRv_rdwI/AAAAAAAAAPI/P8oRQ2zjDg0/s400/DynamicObstacles_3.jpg" alt="" id="BLOGGER_PHOTO_ID_5180998051068344066" border="0" /&gt;&lt;/a&gt;stress test - start of movement&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_GKvgMH3qkR0/R-aaSP_rdxI/AAAAAAAAAPQ/DilMGAHobZk/s1600-h/DynamicObstacles_4.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_GKvgMH3qkR0/R-aaSP_rdxI/AAAAAAAAAPQ/DilMGAHobZk/s400/DynamicObstacles_4.jpg" alt="" id="BLOGGER_PHOTO_ID_5180998059658278674" border="0" /&gt;&lt;/a&gt;stress test - middle of movement.&lt;br /&gt;if you watch closely you can see the bot is not moving along the yellow lines and take shortcuts where possible, this can be seen from the bot direction toward medium green sphere.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-4740154461017911633?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/4740154461017911633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=4740154461017911633' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4740154461017911633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4740154461017911633'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/03/dynamic-obstacle-avodance-integration.html' title='Dynamic Obstacle Avodance Integration'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_GKvgMH3qkR0/R-aaQ__rdtI/AAAAAAAAAOw/KFBWEViC2Ps/s72-c/DynamicObstacles_0.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-219644422313985574</id><published>2008-03-03T02:04:00.001-08:00</published><updated>2008-03-03T02:51:08.838-08:00</updated><title type='text'>Dynamic Obstacle Avoidance</title><content type='html'>Hi, after setting up some basics in my physics engine i realize that my AI system isn't aware of any dynamic object created from the physics engine so i started to think about some generic solution to solve the problem of dynamic avoidance.&lt;br /&gt;until now, i had some basic dynamic obstacle avoidance inside my steering system that check against obstacles on the way and if it found some, it add avoidance forces so the agent while try to steer around the obstacle (works fine for the bots)&lt;br /&gt;the main advantage of this system is that its very simple to implement and it very fast, the disadvantage is that it tries to steer around one obstacle at a time, so if you have few obstacles one after another, it will steer around the first and return, steer around the second and return and so on (does not look very smart), also it doesn't handle the case where few obstacles block our path, it doesn't find a path that goes a around them (if exists) it just tries to steer around the first on the way but end up bumping against them until they moved (and if they wont move you are stuck)&lt;br /&gt;this is unacceptable when you can have a lot of dynamic objects that moves around and could block our path, so i started to build some generic solution to this problem.&lt;br /&gt;the main idea is that i trace a line from my current position to my current goal position (path line), and any obstacle that founded in my way, added to a list of obstacles.&lt;br /&gt;then i check this list against my path line and build "edges graph"/"path tree" from the bounding edges of intersected obstacles and my path line fractions.&lt;br /&gt;this tree is just a graph containing all the combination paths from my current position to my current goal, so then i found the shortest path in the graph and save it as a local path around the obstacles.&lt;br /&gt;of course this is just a brief of the algorithm, there is a lot of tiny things that you need to consider when creating the graph, and also how you can optimize it so you have only few edges to run the shortest path algorithm on.&lt;br /&gt;after i finish the algorithm i had time only to test it against rigid bodies that i throw inside the scene and it really perform well (still need to add few things here and there), i didn't had time to integrate it into my AI system :(&lt;br /&gt;no pictures/movies maybe next time...&lt;br /&gt;BTW: i today i got game programming gems 7, so i have a lot of things to dig into :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-219644422313985574?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/219644422313985574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=219644422313985574' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/219644422313985574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/219644422313985574'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/03/dynamic-obstacle-avoidance.html' title='Dynamic Obstacle Avoidance'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-3550156687790159225</id><published>2008-02-16T09:41:00.000-08:00</published><updated>2008-02-16T10:36:06.307-08:00</updated><title type='text'>Rigid Body Physics #4</title><content type='html'>hi, last weeks i created the physics engine with general constraints, and i though it will be fun to play with them a little, so i added more constraints to the system so i could build more complex systems with it.&lt;br /&gt;the constraints the system support:&lt;br /&gt;1. ball and socket - constraint two bodies to one common point&lt;br /&gt;2. body to body - constraint point on one body to a point on another body&lt;br /&gt;3. body to body with distance - same as 2 but maintain a specific distance between the points&lt;br /&gt;4. body to world - constraint point on a body to be fixed on specific world position&lt;br /&gt;5. body to plane - constraint a body to move inside specific plane&lt;br /&gt;6. body to line - constraint point on a body to move along specific line&lt;br /&gt;7. hinge - constraint point on one body to a point on another body along specific axis with angle limits.&lt;br /&gt;8. universal - same as 1 but constraint an extra degree of freedom, if we specify one axis on body0 and another axis (perpendicular to the first axis) on body1 it keeps them perpendicular.&lt;br /&gt;here is few movies that demonstrate few of the constraints in action:&lt;br /&gt;NOTE: the movies captured in debug mode of the physics system so you'll see some lines and spheres that shows constraints info.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;body to line&lt;br /&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-3175785f94a99f6d" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v20.nonxt1.googlevideo.com/videoplayback?id%3D3175785f94a99f6d%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D2B4B9BBEDD567B642EFA29EF14AB2093A02F1B04.209003D3F99A671C502F2BE5366F7181655468D9%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D3175785f94a99f6d%26offsetms%3D5000%26itag%3Dw160%26sigh%3D5ui59jE17sThm0PRwefLVdJdFYw&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v20.nonxt1.googlevideo.com/videoplayback?id%3D3175785f94a99f6d%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D2B4B9BBEDD567B642EFA29EF14AB2093A02F1B04.209003D3F99A671C502F2BE5366F7181655468D9%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D3175785f94a99f6d%26offsetms%3D5000%26itag%3Dw160%26sigh%3D5ui59jE17sThm0PRwefLVdJdFYw&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;body to plane&lt;br /&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-84ba03ce4ae27afd" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v19.nonxt1.googlevideo.com/videoplayback?id%3D84ba03ce4ae27afd%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D7861EC289CF51861DF147CE3392FFC37B7E18EC1.49EA4D4218497D91BFEB4F55960B4B53A186BEE2%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D84ba03ce4ae27afd%26offsetms%3D5000%26itag%3Dw160%26sigh%3DqaybV3tj3OtxZE7OzACN83GPqzM&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v19.nonxt1.googlevideo.com/videoplayback?id%3D84ba03ce4ae27afd%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D7861EC289CF51861DF147CE3392FFC37B7E18EC1.49EA4D4218497D91BFEB4F55960B4B53A186BEE2%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D84ba03ce4ae27afd%26offsetms%3D5000%26itag%3Dw160%26sigh%3DqaybV3tj3OtxZE7OzACN83GPqzM&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;body to world position&lt;br /&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-e113e557ff20b287" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v16.nonxt1.googlevideo.com/videoplayback?id%3De113e557ff20b287%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D6287ACBCCBC14AEE55BEDC0EF95B3B3E32EE339A.6D88DA37D8BC1C1B8862772C2BE37827A7636BA8%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3De113e557ff20b287%26offsetms%3D5000%26itag%3Dw160%26sigh%3Dc3eUyUgvQCLkmaHOL1XUlo-trAg&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v16.nonxt1.googlevideo.com/videoplayback?id%3De113e557ff20b287%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D6287ACBCCBC14AEE55BEDC0EF95B3B3E32EE339A.6D88DA37D8BC1C1B8862772C2BE37827A7636BA8%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3De113e557ff20b287%26offsetms%3D5000%26itag%3Dw160%26sigh%3Dc3eUyUgvQCLkmaHOL1XUlo-trAg&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;body to body&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-62fdbb4584231b51" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v22.nonxt5.googlevideo.com/videoplayback?id%3D62fdbb4584231b51%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D1BF32117FB407091D58958A25B8B1475523B17C4.E6917DCED6704711DD5D4D669992F39C3F6317%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D62fdbb4584231b51%26offsetms%3D5000%26itag%3Dw160%26sigh%3DDlZEI2IPm52rqVzh9BAev8184dM&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v22.nonxt5.googlevideo.com/videoplayback?id%3D62fdbb4584231b51%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D1BF32117FB407091D58958A25B8B1475523B17C4.E6917DCED6704711DD5D4D669992F39C3F6317%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D62fdbb4584231b51%26offsetms%3D5000%26itag%3Dw160%26sigh%3DDlZEI2IPm52rqVzh9BAev8184dM&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;Hinge&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-3eea557d747d42a9" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v6.nonxt2.googlevideo.com/videoplayback?id%3D3eea557d747d42a9%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D38942797D29B7FF3211EC3F8BC83E7563E7202CF.B6BCDA08C35FE4DEEA97A00BD8D9F87D9803EFF%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D3eea557d747d42a9%26offsetms%3D5000%26itag%3Dw160%26sigh%3DTN1D0PZLzL6vPsDh3Q1GedA2bP8&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v6.nonxt2.googlevideo.com/videoplayback?id%3D3eea557d747d42a9%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D38942797D29B7FF3211EC3F8BC83E7563E7202CF.B6BCDA08C35FE4DEEA97A00BD8D9F87D9803EFF%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D3eea557d747d42a9%26offsetms%3D5000%26itag%3Dw160%26sigh%3DTN1D0PZLzL6vPsDh3Q1GedA2bP8&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-3550156687790159225?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=3175785f94a99f6d&amp;type=video%2Fmp4' length='0'/><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=3eea557d747d42a9&amp;type=video%2Fmp4' length='0'/><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=62fdbb4584231b51&amp;type=video%2Fmp4' length='0'/><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=84ba03ce4ae27afd&amp;type=video%2Fmp4' length='0'/><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=e113e557ff20b287&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/3550156687790159225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=3550156687790159225' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/3550156687790159225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/3550156687790159225'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/02/rigid-body-physics-4.html' title='Rigid Body Physics #4'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-8833383404490350508</id><published>2008-02-02T07:49:00.000-08:00</published><updated>2008-02-02T08:46:47.631-08:00</updated><title type='text'>Rigid Body Physics #3</title><content type='html'>hi, still working on rigid body physics (not an easy task).&lt;br /&gt;i have finished few constraints, (ball &amp;amp; socket, hinge and universal) fixed some collision bugs, improve stability and collision system.&lt;br /&gt;with the new constraints i could start creating rag dolls (maybe next time),&lt;br /&gt;to test the constraints i created simple rope simulation using few universal constraints, and some swinging light, real cool :)&lt;br /&gt;i also added rigid body interactions with other entities like the bots and weapons.&lt;br /&gt;for example: when we shot on a box, the box will be respond to the hit like a real box.&lt;br /&gt;here is few videos that demonstrate the new features:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Weapons interaction&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-774952b0f2f1014c" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v16.nonxt1.googlevideo.com/videoplayback?id%3D774952b0f2f1014c%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D7B0B31F7254AC31CB7265E74A0AE39E9832BFE6A.5A38E72694FA640DAEE1075DF731BE8387B45851%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D774952b0f2f1014c%26offsetms%3D5000%26itag%3Dw160%26sigh%3DZv5LHiZVxeX7PVyqykV3exq4GB4&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v16.nonxt1.googlevideo.com/videoplayback?id%3D774952b0f2f1014c%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D7B0B31F7254AC31CB7265E74A0AE39E9832BFE6A.5A38E72694FA640DAEE1075DF731BE8387B45851%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D774952b0f2f1014c%26offsetms%3D5000%26itag%3Dw160%26sigh%3DZv5LHiZVxeX7PVyqykV3exq4GB4&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt; &lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-886be44b5614678a" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v11.nonxt3.googlevideo.com/videoplayback?id%3D886be44b5614678a%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D1D86ABD9F0176BCAB43BB86C53ABF49A61A6534.6994E9A73264FC957E8E50862BDE9FDFAC500438%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D886be44b5614678a%26offsetms%3D5000%26itag%3Dw160%26sigh%3Ds1VZT4Q1Vkm74EoPG1Ek1pWYL9Q&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v11.nonxt3.googlevideo.com/videoplayback?id%3D886be44b5614678a%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D1D86ABD9F0176BCAB43BB86C53ABF49A61A6534.6994E9A73264FC957E8E50862BDE9FDFAC500438%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D886be44b5614678a%26offsetms%3D5000%26itag%3Dw160%26sigh%3Ds1VZT4Q1Vkm74EoPG1Ek1pWYL9Q&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;Skeleton of simple rope physics&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-5205b56f89c15b8e" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v21.nonxt8.googlevideo.com/videoplayback?id%3D5205b56f89c15b8e%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3DE13B316965FAF2B398797C15CBDADD54A1431EF.7A13E5EBF73B09B39DF29FDCBC16D798E4991D8D%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D5205b56f89c15b8e%26offsetms%3D5000%26itag%3Dw160%26sigh%3Db5ByQtJXObS1uAJEzmaC1NWtpbw&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v21.nonxt8.googlevideo.com/videoplayback?id%3D5205b56f89c15b8e%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3DE13B316965FAF2B398797C15CBDADD54A1431EF.7A13E5EBF73B09B39DF29FDCBC16D798E4991D8D%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D5205b56f89c15b8e%26offsetms%3D5000%26itag%3Dw160%26sigh%3Db5ByQtJXObS1uAJEzmaC1NWtpbw&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-8833383404490350508?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=5205b56f89c15b8e&amp;type=video%2Fmp4' length='0'/><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=774952b0f2f1014c&amp;type=video%2Fmp4' length='0'/><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=886be44b5614678a&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/8833383404490350508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=8833383404490350508' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8833383404490350508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8833383404490350508'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/02/rigid-body-physics-3.html' title='Rigid Body Physics #3'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-1449883643590771651</id><published>2008-01-19T09:31:00.001-08:00</published><updated>2008-01-19T09:59:30.578-08:00</updated><title type='text'>Rigid Body Physics #2</title><content type='html'>hi&lt;br /&gt;i fixed some bugs in the physics engine related to inertia tensor calculations and collisions.&lt;br /&gt;i also add it to my fixed time step scheme, so it will be more smooth.&lt;br /&gt;while checking performance i found a bug in my particle system related to profiler sections, it seems that profiler section started but wasn't ended so it damaged the profiler (this isn't related to rigid body physics but because of this i added nice feature to the profiler so it will show me if sections are not closed properly).&lt;br /&gt;anyway, i founded that my collision system needs optimizations (because of the mesh vs mesh collision), so i searched the net to find some info about generic convex mesh collision and i found something called: GJK algorithm.&lt;br /&gt;i also so that its good to build AABB/OBB trees for the meshes for fast culling.&lt;br /&gt;i already implement AABB tree in my engine for some collision testing at the beginning, now i found some useful area to use it.&lt;br /&gt;as for GJK, i need to read more about it and see how it goes.&lt;br /&gt;in my last update i uploaded screenshots, and its time to add some nice movie to show my physics in action:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-9921edbd0f8724fe" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v13.nonxt2.googlevideo.com/videoplayback?id%3D9921edbd0f8724fe%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D7278247C7208EC0B7B6F447644354CD24DCA0497.C7D27DBC2EB9CA6E71C8CBE008DEE072E4D1193%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D9921edbd0f8724fe%26offsetms%3D5000%26itag%3Dw160%26sigh%3DJv2rRDdhIe5g4TVdkAsyopqClnY&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v13.nonxt2.googlevideo.com/videoplayback?id%3D9921edbd0f8724fe%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331394732%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D7278247C7208EC0B7B6F447644354CD24DCA0497.C7D27DBC2EB9CA6E71C8CBE008DEE072E4D1193%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D9921edbd0f8724fe%26offsetms%3D5000%26itag%3Dw160%26sigh%3DJv2rRDdhIe5g4TVdkAsyopqClnY&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-1449883643590771651?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=9921edbd0f8724fe&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/1449883643590771651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=1449883643590771651' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/1449883643590771651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/1449883643590771651'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/01/rigid-body-physics-2.html' title='Rigid Body Physics #2'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-8383167128862051678</id><published>2008-01-12T10:10:00.000-08:00</published><updated>2008-01-13T02:44:42.073-08:00</updated><title type='text'>Rigid Body Physics</title><content type='html'>hi, i decided to add some rigid body physics.&lt;br /&gt;there is a lot of physics engines out there that i could integrate into my engine, so i have checked few engines such as Agiea PhysX, newton dynamics and ode.&lt;br /&gt;Agiea PhysX seems to be very fast and stable, and it comes with great sdk with tons of examples, so i decided to give it a try.&lt;br /&gt;while trying t integrate i have founded that its not so great for me, because i already have very good and fast collision system that i'm using in my AI, projectiles,camera collision and more, so to make use of external lib i must change all the places that use my system to use theirs.&lt;br /&gt;this wasn't an option because i need to check that everything that was working is still works after the change.&lt;br /&gt;i could use their engine with my own systems but it required to duplicate the data, the scene for example must be known by both systems so they and mine could do collisions.&lt;br /&gt;also, i just want simple physics and i wont even use all the features that Agiea PhysX support so i decided to write my own physics engine so the integration will be smooth and clean, this will take some time to do but i think its worth the a effort, i also will learn from the process :)&lt;br /&gt;my physics system is impulsed based, that means that in order to move an object an impulse to act on the object on a certain point.&lt;br /&gt;i choose to use impulsed base physics engine so i wont need to solve big linear equations system every frame, also i could give x ms for the physics engine and things that didn't solved correctly in current frame will get a chance next frame.&lt;br /&gt;also in impulsed base, constraints system isn't stiff, that means the constraints is trying to be preserved by applying forces every frame/iteration, this is different from linear systems (implicit method) because if the system can't be solved (for example: one of the constraint needs very big forces to be preserved) the system will explode.&lt;br /&gt;after reading some materials and got refreshed in my calculus, i'v started to wrote the engine.&lt;br /&gt;i have finished the integration, also add simple shapes: sphere, box, cylinder&lt;br /&gt;the collision system is also finished and support rigid body vs scene and rigid body vs rigid body collision.&lt;br /&gt;for now each rigid body is a mesh, so the collision basically does mesh vs mesh collision, this simplify the things a lot because i don't need to a lot of collision functions based on rigid bodies type.&lt;br /&gt;i also started working on few joint constraints: ball &amp;amp; socket, hinge and universal, next time i hope i will finish it and put some screenshots :)&lt;br /&gt;here is few screenshots of the rigid bodies in action (wireframe mode).&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;box stacks&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_GKvgMH3qkR0/R4kPOtV-ByI/AAAAAAAAAOo/x0O0EsRrrRc/s1600-h/RigidBody_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_GKvgMH3qkR0/R4kPOtV-ByI/AAAAAAAAAOo/x0O0EsRrrRc/s400/RigidBody_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5154667993866569506" border="0" /&gt;&lt;/a&gt;one of the stacks lost balance and fall &lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_GKvgMH3qkR0/R4kPItV-BxI/AAAAAAAAAOg/Z4b_rZGKwEQ/s1600-h/RigidBody_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_GKvgMH3qkR0/R4kPItV-BxI/AAAAAAAAAOg/Z4b_rZGKwEQ/s400/RigidBody_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5154667890787354386" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-8383167128862051678?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/8383167128862051678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=8383167128862051678' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8383167128862051678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8383167128862051678'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2008/01/rigid-body-physics.html' title='Rigid Body Physics'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_GKvgMH3qkR0/R4kPOtV-ByI/AAAAAAAAAOo/x0O0EsRrrRc/s72-c/RigidBody_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-5665379808129173046</id><published>2007-12-22T08:41:00.000-08:00</published><updated>2007-12-22T08:53:29.254-08:00</updated><title type='text'>Per pixel lit particles</title><content type='html'>Hi, i added nice feature: per pixel lit particles.&lt;br /&gt;i can now set if particles emitter needed per pixel lighting via effects file, so this emitter will effected by scene lights.&lt;br /&gt;the effect rendered with shader model 3, so i could gather more than one light and render the particles in one pass.&lt;br /&gt;for example: if i create smoke particles and the particles goes through red light, the particles will get some of the red color from the light.&lt;br /&gt;here is few screenshots:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;left: unlit smoke, right: lit smoke&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_GKvgMH3qkR0/R21AeNV-BvI/AAAAAAAAAOQ/v00jyGfhGJQ/s1600-h/PerPixelLitParticles_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_GKvgMH3qkR0/R21AeNV-BvI/AAAAAAAAAOQ/v00jyGfhGJQ/s400/PerPixelLitParticles_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5146840836876404466" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-5665379808129173046?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/5665379808129173046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=5665379808129173046' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/5665379808129173046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/5665379808129173046'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/12/per-pixel-lit-particles.html' title='Per pixel lit particles'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_GKvgMH3qkR0/R21AeNV-BvI/AAAAAAAAAOQ/v00jyGfhGJQ/s72-c/PerPixelLitParticles_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-3654600649166243025</id><published>2007-12-22T08:33:00.000-08:00</published><updated>2007-12-22T08:41:16.612-08:00</updated><title type='text'>Under water effects</title><content type='html'>I did some changes in the rendering order, because when i worked with scenes with water surfaces i notice that particles and decals effects doesn't rendered correctly under water, so few fixes here and there, moving fews functions to the right place fixed the problem :)&lt;br /&gt;here is few screenshots:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;under water blast&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_GKvgMH3qkR0/R2091NV-BsI/AAAAAAAAAN4/XuHjeW9f4zQ/s1600-h/Underwater_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_GKvgMH3qkR0/R2091NV-BsI/AAAAAAAAAN4/XuHjeW9f4zQ/s400/Underwater_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5146837933478512322" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_GKvgMH3qkR0/R2091tV-BtI/AAAAAAAAAOA/86g9rqcSNHY/s1600-h/Underwater_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_GKvgMH3qkR0/R2091tV-BtI/AAAAAAAAAOA/86g9rqcSNHY/s400/Underwater_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5146837942068446930" border="0" /&gt;&lt;/a&gt;under water smoke&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_GKvgMH3qkR0/R2092tV-BuI/AAAAAAAAAOI/YadfxWz1mCg/s1600-h/Underwater_2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_GKvgMH3qkR0/R2092tV-BuI/AAAAAAAAAOI/YadfxWz1mCg/s400/Underwater_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5146837959248316130" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-3654600649166243025?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/3654600649166243025/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=3654600649166243025' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/3654600649166243025'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/3654600649166243025'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/12/under-water-effects.html' title='Under water effects'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_GKvgMH3qkR0/R2091NV-BsI/AAAAAAAAAN4/XuHjeW9f4zQ/s72-c/Underwater_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-1877621623873734238</id><published>2007-12-13T03:46:00.000-08:00</published><updated>2007-12-13T04:09:09.431-08:00</updated><title type='text'>Weapons Lighting Effects</title><content type='html'>hi, last weeks was very stressed because finally the baby comes out :) - yes i'm now officially a father, this i very new to me and i'm trying to adjust myself to the new situation, can't tell you how happy i'm, this is amazing feeling :)&lt;br /&gt;&lt;br /&gt;for now i'm finding few minutes here and there so this new update i just a new feature i added to the effects system, this feature allow you to create and attach dynamic light to specific effect.&lt;br /&gt;for example: when you fire your weapon you see the muzzle flash effects a small area around it, this is because the muzzle flash is a real light and it lights the area around it.&lt;br /&gt;to create this realistic effect i changed effects script and add dynamic light with small radius for x milliseconds for the muzzle flash effect, this way the area near the flash will be lighted.&lt;br /&gt;i also changed rocket effect so it will create light attach to the rocket and cast shadows.&lt;br /&gt;here is few screenshots:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;muzzle flash lights the area around&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_GKvgMH3qkR0/R2EgDQInz6I/AAAAAAAAANg/M3pwqa9jBuM/s1600-h/LightEffect_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_GKvgMH3qkR0/R2EgDQInz6I/AAAAAAAAANg/M3pwqa9jBuM/s400/LightEffect_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5143427489676644258" border="0" /&gt;&lt;/a&gt;muzzle flash lights the character&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_GKvgMH3qkR0/R2EgDgInz7I/AAAAAAAAANo/BE4FhrgE6gs/s1600-h/LightEffect_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_GKvgMH3qkR0/R2EgDgInz7I/AAAAAAAAANo/BE4FhrgE6gs/s400/LightEffect_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5143427493971611570" border="0" /&gt;&lt;/a&gt;rocket cast shadows and lights the area around&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_GKvgMH3qkR0/R2EgDwInz8I/AAAAAAAAANw/630yBMCgres/s1600-h/LightEffect_2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_GKvgMH3qkR0/R2EgDwInz8I/AAAAAAAAANw/630yBMCgres/s400/LightEffect_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5143427498266578882" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-1877621623873734238?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/1877621623873734238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=1877621623873734238' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/1877621623873734238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/1877621623873734238'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/12/weapons-lighting-effects.html' title='Weapons Lighting Effects'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_GKvgMH3qkR0/R2EgDQInz6I/AAAAAAAAANg/M3pwqa9jBuM/s72-c/LightEffect_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-1944631211547273983</id><published>2007-12-01T10:20:00.000-08:00</published><updated>2007-12-01T10:42:05.533-08:00</updated><title type='text'>Freezing the scene</title><content type='html'>hi, it became very difficult to debug AI and effects, so i thought it will be nice if i could freeze the scene and move with my camera to see things from closer view.&lt;br /&gt;so i added the new feature along with few options:&lt;br /&gt;1. freezing the scene and get a free camera so i could move around, good for debugging effects from different view.&lt;br /&gt;2. do one update step so i could see how things get updated, good for AI debugging.&lt;br /&gt;3. keep my free camera and let the scene updated for a while, good to see how bots moves and fight.&lt;br /&gt;here is few screenshots that couldn't be captured without freezing the scene.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/R1GqyAInz3I/AAAAAAAAANI/NwPyzpeAtPA/s1600-R/Freeze_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/R1GqyAInz3I/AAAAAAAAANI/3LUmBdKj0aM/s400/Freeze_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5139076425812791154" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/R1GqyAInz4I/AAAAAAAAANQ/jOl6pP47EPM/s1600-R/Freeze_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/R1GqyAInz4I/AAAAAAAAANQ/xFhBqiKHGR0/s400/Freeze_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5139076425812791170" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_GKvgMH3qkR0/R1GqygInz5I/AAAAAAAAANY/smdWdlTW0V8/s1600-R/Freeze_2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_GKvgMH3qkR0/R1GqygInz5I/AAAAAAAAANY/lx4yAqQwkk0/s400/Freeze_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5139076434402725778" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-1944631211547273983?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/1944631211547273983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=1944631211547273983' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/1944631211547273983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/1944631211547273983'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/12/freezing-scene.html' title='Freezing the scene'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_GKvgMH3qkR0/R1GqyAInz3I/AAAAAAAAANI/3LUmBdKj0aM/s72-c/Freeze_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-4532665173842710414</id><published>2007-11-25T05:19:00.001-08:00</published><updated>2007-11-25T05:40:59.200-08:00</updated><title type='text'>Input Manager</title><content type='html'>Input manager is not the main thing you need but its certainly a thing you should have, and its not so complicated to do, so i created input manager class that will handle questions like:&lt;br /&gt;IsMouseButtonGoingDown/Up? IsMouseBottunUp?&lt;br /&gt;IsKeyGoingDown/Up? IsKeyDown?&lt;br /&gt;the 'going' notation is to indicate that we want to know if specific action is about to be triggered, for example: if we want to know when specific key is pressed, we use IsKeyGoingDown, but if the key already pushed and we want to now when we released him we use IsKeyGoingUp, at last if we want to perform some action as long as the key is down we just use IsKeyDown (same for mouse functions).&lt;br /&gt;the input manager uses directinput8 to communicate with hardware devices such keyboard, mouse, joystick (for now i'm using only keyboard and mouse devices).&lt;br /&gt;i also add support for keyboard layout, which allow me to distinguish between different input languages, so now you can type in other languages besides english.&lt;br /&gt;still, i need to match the right font file in order to see the right characters, but this is just a matter of exporting new font texture.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-4532665173842710414?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/4532665173842710414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=4532665173842710414' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4532665173842710414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/4532665173842710414'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/11/input-manager.html' title='Input Manager'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-7823723726620740828</id><published>2007-11-24T09:35:00.000-08:00</published><updated>2007-11-24T09:51:59.294-08:00</updated><title type='text'>Weapon Effects</title><content type='html'>i'v just finished setting weapons effects script.&lt;br /&gt;i added muzzle flash effect per weapon, each weapon have its own muzzle flash effect.&lt;br /&gt;for example: machinegun flashes different and more frequently than shotgun, shotgun also lives some smoke after the shot.&lt;br /&gt;impact effect also added per weapon, each weapon bolt/projectile lives its own mark and create different effect.&lt;br /&gt;for example: rocket effect is the most complicated, it creates smoke trails, fire trails, heat effect (because fire and smoke), sparks and rocket flash.&lt;br /&gt;i also worked on weapon handling, when weapon clip is finished reload sequence is started so you cant shot until finished.&lt;br /&gt;here is few screenshots:&lt;br /&gt;&lt;div style="text-align: center;"&gt;reload and impact effect&lt;br /&gt;note: the red color on the weapon is the gui that&lt;br /&gt;shows how much bolts you have&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_GKvgMH3qkR0/R0hjMl9hBwI/AAAAAAAAAMw/kOy_6Dpauwk/s1600-h/WeaponEffects_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_GKvgMH3qkR0/R0hjMl9hBwI/AAAAAAAAAMw/kOy_6Dpauwk/s400/WeaponEffects_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5136464443015759618" border="0" /&gt;&lt;/a&gt;shotgun - muzzle flash&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_GKvgMH3qkR0/R0hjNF9hBxI/AAAAAAAAAM4/avfPyBGRiDc/s1600-h/WeaponEffects_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_GKvgMH3qkR0/R0hjNF9hBxI/AAAAAAAAAM4/avfPyBGRiDc/s400/WeaponEffects_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5136464451605694226" border="0" /&gt;&lt;/a&gt;machinegun - muzzle flash&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_GKvgMH3qkR0/R0hjNF9hByI/AAAAAAAAANA/Xtd0MMyTMNg/s1600-h/WeaponEffects_2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_GKvgMH3qkR0/R0hjNF9hByI/AAAAAAAAANA/Xtd0MMyTMNg/s400/WeaponEffects_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5136464451605694242" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-7823723726620740828?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/7823723726620740828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=7823723726620740828' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7823723726620740828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7823723726620740828'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/11/weapon-effects.html' title='Weapon Effects'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_GKvgMH3qkR0/R0hjMl9hBwI/AAAAAAAAAMw/kOy_6Dpauwk/s72-c/WeaponEffects_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-376309284044210722</id><published>2007-11-23T11:02:00.000-08:00</published><updated>2007-11-23T11:23:27.117-08:00</updated><title type='text'>HUD</title><content type='html'>hi, recently i have worked on game play, one of the things i'v added is hud (heads up display).&lt;br /&gt;at the bottom of the screen you will see which weapon you are using, how much ammo left, health and armor, also when your are hit by something you will see red mark on the screen that will fade out.&lt;br /&gt;the hud is based on the gui system i was worked on, while adding the hud i found couple of bugs in the gui system, some of them was critical, but i fixed them :).&lt;br /&gt;until now, all gui rendering was handled by id3dxsprite interface, and gui elements didn't have full material like i'v used on 3d surface (they have just the texture so i could display it).&lt;br /&gt;one of the changes i'v done was the removing of id3dxsprite interface from gui renderer and adding my own sprite renderer with specific gui shader.&lt;br /&gt;i also removed the texture and add full material support like i'v used on 3d surfaces, so each 2d gui surface will support all the features on 3d surface material.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/R0coOF9hBuI/AAAAAAAAAMg/CCVoVUkzvrY/s1600-h/HUD_0.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/R0coOF9hBuI/AAAAAAAAAMg/CCVoVUkzvrY/s400/HUD_0.JPG" alt="" id="BLOGGER_PHOTO_ID_5136118122622813922" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/R0coOF9hBvI/AAAAAAAAAMo/9X-wgLsUXrk/s1600-h/HUD_1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/R0coOF9hBvI/AAAAAAAAAMo/9X-wgLsUXrk/s400/HUD_1.JPG" alt="" id="BLOGGER_PHOTO_ID_5136118122622813938" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-376309284044210722?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/376309284044210722/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=376309284044210722' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/376309284044210722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/376309284044210722'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/11/hud.html' title='HUD'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_GKvgMH3qkR0/R0coOF9hBuI/AAAAAAAAAMg/CCVoVUkzvrY/s72-c/HUD_0.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-5750286520213974461</id><published>2007-11-10T04:16:00.000-08:00</published><updated>2007-11-10T04:57:10.490-08:00</updated><title type='text'>Flashlights</title><content type='html'>hi&lt;br /&gt;i always liked the cut scene in games when you see few agents walking in a dark room and you see their flashlight moves.&lt;br /&gt;flashlight is really cool effect i wanted to add long time but i always had something more important to add, last week i finally add it.&lt;br /&gt;to polish this effect i added flashlight beam/volume to create the illusion of volume lighting, and last thing - every flashlight cast shadows.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;flashlight volume/beam&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_GKvgMH3qkR0/RzWonZp5yzI/AAAAAAAAAMA/hYK8XSyXiD8/s1600-h/Flashlight_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_GKvgMH3qkR0/RzWonZp5yzI/AAAAAAAAAMA/hYK8XSyXiD8/s400/Flashlight_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5131192745313553202" border="0" /&gt;&lt;/a&gt;correct order&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_GKvgMH3qkR0/RzWonZp5y0I/AAAAAAAAAMI/58B0sIdh-lg/s1600-h/Flashlight_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_GKvgMH3qkR0/RzWonZp5y0I/AAAAAAAAAMI/58B0sIdh-lg/s400/Flashlight_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5131192745313553218" border="0" /&gt;&lt;/a&gt;top view - player flashlight is off so no shadow&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/RzWonpp5y1I/AAAAAAAAAMQ/EiIFIzFzaS8/s1600-h/Flashlight_2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/RzWonpp5y1I/AAAAAAAAAMQ/EiIFIzFzaS8/s400/Flashlight_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5131192749608520530" border="0" /&gt;&lt;/a&gt;top view - player flashlight cast shadow&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/RzWonpp5y2I/AAAAAAAAAMY/aES_EVC1AzQ/s1600-h/Flashlight_3.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/RzWonpp5y2I/AAAAAAAAAMY/aES_EVC1AzQ/s400/Flashlight_3.jpg" alt="" id="BLOGGER_PHOTO_ID_5131192749608520546" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-5750286520213974461?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/5750286520213974461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=5750286520213974461' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/5750286520213974461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/5750286520213974461'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/11/flashlights.html' title='Flashlights'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_GKvgMH3qkR0/RzWonZp5yzI/AAAAAAAAAMA/hYK8XSyXiD8/s72-c/Flashlight_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-1235267206949125088</id><published>2007-11-03T05:23:00.000-07:00</published><updated>2007-11-03T09:16:52.779-07:00</updated><title type='text'>Soft Shadows continued</title><content type='html'>like all shadow map algorithms, VSM also suffer from something called light bleeding (instead of shadows you will see some light color pops at the middle), this is due to the fact that its a probabilistic algorithm.&lt;br /&gt;when the variance over a filter region is high we probably see light bleeding artifacts, we more likely to see LB in scenes where depth complexity is high.&lt;br /&gt;the good news is that VSM have a lot more advantages than disadvantages if we compare it to other pixel based shadows algorithm, also we can reduce the light bleeding issue by doing a smoothstep with the variance value and some threshold.&lt;br /&gt;some of the advantages:&lt;br /&gt;1. we can use mip maps on the "shadow map" texture (the variance map).&lt;br /&gt;2. we can blur it like regular texture blurring (no pcf needed), and because of that we can use hardware filtering so as linear, anisotropic etc.&lt;br /&gt;3. we can get good soft shadows a lot faster and smoother than using pcf.&lt;br /&gt;&lt;br /&gt;i have added softness for both spot and point lights, point light is a little bit tricky :)&lt;br /&gt;here is few screenshots:&lt;br /&gt;&lt;div style="text-align: center;"&gt;no soft applied&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_GKvgMH3qkR0/Ryxxj5oDAuI/AAAAAAAAALg/4Hr74ihSfsE/s1600-h/softshadows_0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_GKvgMH3qkR0/Ryxxj5oDAuI/AAAAAAAAALg/4Hr74ihSfsE/s400/softshadows_0.jpg" alt="" id="BLOGGER_PHOTO_ID_5128598937246302946" border="0" /&gt;&lt;/a&gt;with soft applied&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_GKvgMH3qkR0/RyxxkJoDAvI/AAAAAAAAALo/0D_DjRpTGLg/s1600-h/softshadows_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_GKvgMH3qkR0/RyxxkJoDAvI/AAAAAAAAALo/0D_DjRpTGLg/s400/softshadows_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5128598941541270258" border="0" /&gt;&lt;/a&gt;no soft applied&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_GKvgMH3qkR0/RyxxkJoDAwI/AAAAAAAAALw/uB_1m6wfjaI/s1600-h/softshadows_2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_GKvgMH3qkR0/RyxxkJoDAwI/AAAAAAAAALw/uB_1m6wfjaI/s400/softshadows_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5128598941541270274" border="0" /&gt;&lt;/a&gt;with soft applied&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/RyxxkZoDAxI/AAAAAAAAAL4/tsJ5Jcq2rPg/s1600-h/softshadows_3.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/RyxxkZoDAxI/AAAAAAAAAL4/tsJ5Jcq2rPg/s400/softshadows_3.jpg" alt="" id="BLOGGER_PHOTO_ID_5128598945836237586" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-1235267206949125088?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/1235267206949125088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=1235267206949125088' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/1235267206949125088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/1235267206949125088'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/11/soft-shadows-continued.html' title='Soft Shadows continued'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_GKvgMH3qkR0/Ryxxj5oDAuI/AAAAAAAAALg/4Hr74ihSfsE/s72-c/softshadows_0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-5616039294058666300</id><published>2007-10-27T12:12:00.000-07:00</published><updated>2007-10-27T12:27:52.046-07:00</updated><title type='text'>Soft Shadows</title><content type='html'>i have added soft shadows using variance shadow map (VSM) for both point and spot lights, i also convert shadow code to use this new shadow technique because stencil shadows is fill rate/cpu intensive, especially for dynamic scene.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-5616039294058666300?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/5616039294058666300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=5616039294058666300' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/5616039294058666300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/5616039294058666300'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/10/soft-shadows.html' title='Soft Shadows'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-1399032165545359192</id><published>2007-10-20T05:39:00.000-07:00</published><updated>2007-10-20T05:50:22.242-07:00</updated><title type='text'>Different Head</title><content type='html'>hi&lt;br /&gt;i fix huge bug in md5 model, it seams that when i converted it to the new design i forgot update the transformation matrices (of the bones) after loading the mesh so every model that didn't had  animation controller or bind animation will be wrong and distorted.&lt;br /&gt;i found this while trying to add different head models (to same body model), and i so that the transformations matrices was identity!&lt;br /&gt;here is screenshots marine model with different head:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_GKvgMH3qkR0/Rxn4wMzpIbI/AAAAAAAAAEg/XusUOlfMz1g/s1600-h/heads0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_GKvgMH3qkR0/Rxn4wMzpIbI/AAAAAAAAAEg/XusUOlfMz1g/s400/heads0.jpg" alt="" id="BLOGGER_PHOTO_ID_5123399558065889714" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_GKvgMH3qkR0/Rxn43MzpIcI/AAAAAAAAAEo/EZTj9a8UlwM/s1600-h/heads1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_GKvgMH3qkR0/Rxn43MzpIcI/AAAAAAAAAEo/EZTj9a8UlwM/s400/heads1.jpg" alt="" id="BLOGGER_PHOTO_ID_5123399678324974018" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-1399032165545359192?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/1399032165545359192/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=1399032165545359192' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/1399032165545359192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/1399032165545359192'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/10/different-head.html' title='Different Head'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_GKvgMH3qkR0/Rxn4wMzpIbI/AAAAAAAAAEg/XusUOlfMz1g/s72-c/heads0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-5097411707330456108</id><published>2007-10-13T10:42:00.000-07:00</published><updated>2007-10-13T10:56:32.280-07:00</updated><title type='text'>Dynamic Fluid on GPU</title><content type='html'>hi&lt;br /&gt;i'v added dynamic water/fluid interaction on GPU using 2 render target and simple wave equation, so when you fire on water/fluid surfaces you will see the waves the bullet cause.&lt;br /&gt;here is a screenshot:&lt;br /&gt;&lt;br /&gt;&lt;a href="javascript:void(0)" tabindex="10" onclick="return false;"&gt;&lt;span&gt;&lt;/span&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_GKvgMH3qkR0/RxEGg8zpIaI/AAAAAAAAAEY/0jj8oHD0z7o/s1600-h/Fluid0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_GKvgMH3qkR0/RxEGg8zpIaI/AAAAAAAAAEY/0jj8oHD0z7o/s400/Fluid0.jpg" alt="" id="BLOGGER_PHOTO_ID_5120881414445277602" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-5097411707330456108?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/5097411707330456108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=5097411707330456108' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/5097411707330456108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/5097411707330456108'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/10/dynamic-fluid-on-gpu.html' title='Dynamic Fluid on GPU'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_GKvgMH3qkR0/RxEGg8zpIaI/AAAAAAAAAEY/0jj8oHD0z7o/s72-c/Fluid0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-6974192132962292128</id><published>2007-09-29T09:18:00.000-07:00</published><updated>2007-09-29T10:02:00.659-07:00</updated><title type='text'>Water surfaces</title><content type='html'>hi&lt;br /&gt;a lot of features and bug fixes, one of them is water surfaces.&lt;br /&gt;i'v added water surfaces at the beginning but there was no lights interaction with it, i just rendered it last and it doesn't looks real, one of the main changes i made is recreating the material system so each material stage could use different shader, also each shader need to have few techniques if light interaction is needed.&lt;br /&gt;after all shaders recreated for this new material system, every surface in the game could define how light interaction will effect the surface, so water will effected by lights.&lt;br /&gt;i'v also fix refraction mask generation, i'm using ambient pass to generate refraction map, after that i'm rendering water surface into alpha channel of this map so i could mask pixels that doesn't need to be effected by water pertubation effect.&lt;br /&gt;here is few screenshots of water inside the game.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;ambient and point light&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_GKvgMH3qkR0/Rv6Df42uJeI/AAAAAAAAAEA/j7HgicdRHyI/s1600-h/water0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_GKvgMH3qkR0/Rv6Df42uJeI/AAAAAAAAAEA/j7HgicdRHyI/s400/water0.jpg" alt="" id="BLOGGER_PHOTO_ID_5115670810600547810" border="0" /&gt;&lt;/a&gt;flash light interaction&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_GKvgMH3qkR0/Rv6Dk42uJfI/AAAAAAAAAEI/jFg3afYL60c/s1600-h/water1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_GKvgMH3qkR0/Rv6Dk42uJfI/AAAAAAAAAEI/jFg3afYL60c/s400/water1.jpg" alt="" id="BLOGGER_PHOTO_ID_5115670896499893746" border="0" /&gt;&lt;/a&gt;refraction (close look)&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/Rv6DrI2uJgI/AAAAAAAAAEQ/vuPKiHPaf-8/s1600-h/water2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/Rv6DrI2uJgI/AAAAAAAAAEQ/vuPKiHPaf-8/s400/water2.jpg" alt="" id="BLOGGER_PHOTO_ID_5115671003874076162" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-6974192132962292128?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/6974192132962292128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=6974192132962292128' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6974192132962292128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/6974192132962292128'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/09/water-surfaces.html' title='Water surfaces'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_GKvgMH3qkR0/Rv6Df42uJeI/AAAAAAAAAEA/j7HgicdRHyI/s72-c/water0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-7930912687828629893</id><published>2007-09-15T10:56:00.000-07:00</published><updated>2007-09-15T11:11:03.089-07:00</updated><title type='text'>Soft Particles</title><content type='html'>hi&lt;br /&gt;one of DX10 features is the ability to read from depth buffer, in DX9 you can't do it unless you are generating it by yourself and pass it as texture.&lt;br /&gt;in my ambient pass i'm using multiple render target, one for color buffer and one for depth, after that i'm setting it as texture and use it when needed in the pixel shader.&lt;br /&gt;for soft particle effect, i'm reading the depth value from depth buffer rt and compare it with particle depth, then i'm compute new alpha value based on the difference between those values, (closest particle to level surfaces = more transparent).&lt;br /&gt;here is few screenshots of the effect.&lt;br /&gt;i marked in red the area the particles intersect with level surfaces.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_GKvgMH3qkR0/RuwfB6_DXkI/AAAAAAAAADw/ssoTm5AcVTU/s1600-h/softparticlesB_2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_GKvgMH3qkR0/RuwfB6_DXkI/AAAAAAAAADw/ssoTm5AcVTU/s400/softparticlesB_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5110493795032718914" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_GKvgMH3qkR0/Ruwe-q_DXjI/AAAAAAAAADo/-wn34iQu17c/s1600-h/softparticlesB_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_GKvgMH3qkR0/Ruwe-q_DXjI/AAAAAAAAADo/-wn34iQu17c/s400/softparticlesB_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5110493739198144050" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/Ruwe7a_DXiI/AAAAAAAAADg/AiZV00cbOE0/s1600-h/softparticlesA_2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/Ruwe7a_DXiI/AAAAAAAAADg/AiZV00cbOE0/s400/softparticlesA_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5110493683363569186" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_GKvgMH3qkR0/Ruwe36_DXhI/AAAAAAAAADY/fAyhjh0JQAE/s1600-h/softparticlesA_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_GKvgMH3qkR0/Ruwe36_DXhI/AAAAAAAAADY/fAyhjh0JQAE/s400/softparticlesA_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5110493623234027026" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-7930912687828629893?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/7930912687828629893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=7930912687828629893' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7930912687828629893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7930912687828629893'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/09/soft-particles.html' title='Soft Particles'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_GKvgMH3qkR0/RuwfB6_DXkI/AAAAAAAAADw/ssoTm5AcVTU/s72-c/softparticlesB_2.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-2410173144360034542</id><published>2007-09-08T05:01:00.000-07:00</published><updated>2007-09-09T01:22:10.934-07:00</updated><title type='text'>MegaTexture</title><content type='html'>hi&lt;br /&gt;after seeing id tech 5 mega texturing, i though how the heal he did that?&lt;br /&gt;so i start digging and reading a lot about clipmaps and streaming and i succeeded creating mega texturing.&lt;br /&gt;to create the huge textures i'm using L3DT (pro trial version) i'v created 8k and 16k, the 16k texture took more than 12 hours to complete and with 5 mip levels its takes 1 giga.&lt;br /&gt;my computer have only 1 giga ram so it's not impossible to use this texture in system mem.&lt;br /&gt;here is few screenshots showing the difference between using mega texturing and not.&lt;br /&gt;note that this is just sample app using engine features but for now its isn't integrated inside.&lt;br /&gt;the app uses 16k streaming texture with about 20 mb gpu mem.&lt;br /&gt;the fps difference is big because mega texture ps takes 74 instructions (not optimized)&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;using mega texture&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/RuKUDI5qg7I/AAAAAAAAADQ/pUMWjP9gwrU/s1600-h/mega3_with.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/RuKUDI5qg7I/AAAAAAAAADQ/pUMWjP9gwrU/s400/mega3_with.jpg" alt="" id="BLOGGER_PHOTO_ID_5107807709041427378" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_GKvgMH3qkR0/RuKT945qg6I/AAAAAAAAADI/DgF5qpxuX0o/s1600-h/mega2_with.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_GKvgMH3qkR0/RuKT945qg6I/AAAAAAAAADI/DgF5qpxuX0o/s400/mega2_with.jpg" alt="" id="BLOGGER_PHOTO_ID_5107807618847114146" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/RuKT6I5qg5I/AAAAAAAAADA/KfMk5g0OJBA/s1600-h/mega1_with.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/RuKT6I5qg5I/AAAAAAAAADA/KfMk5g0OJBA/s400/mega1_with.jpg" alt="" id="BLOGGER_PHOTO_ID_5107807554422604690" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;not using mega texture (very blurry)&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_GKvgMH3qkR0/RuKTy45qg4I/AAAAAAAAAC4/S52YaGgFwNg/s1600-h/mega3_without.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_GKvgMH3qkR0/RuKTy45qg4I/AAAAAAAAAC4/S52YaGgFwNg/s400/mega3_without.jpg" alt="" id="BLOGGER_PHOTO_ID_5107807429868553090" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_GKvgMH3qkR0/RuKTuo5qg3I/AAAAAAAAACw/G95c7C3uf1Y/s1600-h/mega2_without.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_GKvgMH3qkR0/RuKTuo5qg3I/AAAAAAAAACw/G95c7C3uf1Y/s400/mega2_without.jpg" alt="" id="BLOGGER_PHOTO_ID_5107807356854109042" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/RuKTbI5qg1I/AAAAAAAAACg/l0oZAlnPTSc/s1600-h/mega1_without.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/RuKTbI5qg1I/AAAAAAAAACg/l0oZAlnPTSc/s400/mega1_without.jpg" alt="" id="BLOGGER_PHOTO_ID_5107807021846659922" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-2410173144360034542?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/2410173144360034542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=2410173144360034542' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2410173144360034542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2410173144360034542'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/09/megatexture.html' title='MegaTexture'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_GKvgMH3qkR0/RuKUDI5qg7I/AAAAAAAAADQ/pUMWjP9gwrU/s72-c/mega3_with.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-2573362999619783795</id><published>2007-08-12T01:48:00.000-07:00</published><updated>2007-08-12T02:39:25.975-07:00</updated><title type='text'>Fixed time step</title><content type='html'>hi&lt;br /&gt;i have added fixed time step with new interagor (midpoint or rk4) to the physics simulation (objects movement), until now i used the frame dt with euler (yes euler - very lame) integration and the results was very bad, the movement was very jerky (very noticeable when fps goes down and up during the game).&lt;br /&gt;the problem is this, when we are using numerical integrations the result depends on the dt, the larger the dt the less accurate result we get, so if develop our simulation to run at 60 fps (dt = 1/60)  and at some point the frame rate drops to 10 fps then the result we get is very inaccurate and results very odd movement (or even exploding), this is true for advance integrations as well - verlet, midpoint, rk4 etc...&lt;br /&gt;with the new fixed dt, i assure the physics simulation runs at the same speed as the display frame rate (sync with it), so if the display frame rate is 30 fps and the physics design to run in 60 fps then we need to do 2 physics steps for every display update to make physics in sync.&lt;br /&gt;i also added a final touch that interpolate between 2 physics states (previous and current) based on some alpha.&lt;br /&gt;interpolation is needed to handle cases when the physics frame rate is not divided by display frame rate (without a remainder), for example the frame rate is 50 fps and the physics is 60 fps, so every frame the algorithm will have to alternate between 2 physics steps or one, this will be good enough to keep it in sync but visually it looks jerky.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-2573362999619783795?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/2573362999619783795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=2573362999619783795' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2573362999619783795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2573362999619783795'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/08/fixed-time-step.html' title='Fixed time step'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-8217187395849639087</id><published>2007-08-04T10:10:00.000-07:00</published><updated>2007-08-04T10:21:19.567-07:00</updated><title type='text'>GUI Screen shots</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/RrS1CaBXhZI/AAAAAAAAACI/VZyNBsWrRFw/s1600-h/gui3_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/RrS1CaBXhZI/AAAAAAAAACI/VZyNBsWrRFw/s400/gui3_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5094896131412297106" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_GKvgMH3qkR0/RrS1G6BXhaI/AAAAAAAAACQ/tvVVSAiShVc/s1600-h/gui3_2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_GKvgMH3qkR0/RrS1G6BXhaI/AAAAAAAAACQ/tvVVSAiShVc/s400/gui3_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5094896208721708450" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/RrS1KaBXhbI/AAAAAAAAACY/tT6Cjc0QehM/s1600-h/gui3_3.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/RrS1KaBXhbI/AAAAAAAAACY/tT6Cjc0QehM/s400/gui3_3.jpg" alt="" id="BLOGGER_PHOTO_ID_5094896268851250610" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-8217187395849639087?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/8217187395849639087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=8217187395849639087' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8217187395849639087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/8217187395849639087'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/08/gui-screen-shots.html' title='GUI Screen shots'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_GKvgMH3qkR0/RrS1CaBXhZI/AAAAAAAAACI/VZyNBsWrRFw/s72-c/gui3_1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-3019171375347315992</id><published>2007-07-28T11:00:00.001-07:00</published><updated>2007-07-28T11:03:55.299-07:00</updated><title type='text'>Outdoor scenes</title><content type='html'>hi, a a lot of updates i have integrated the GUI on weapons, also add option to add terrian models to map, see pictures below:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/RquEeqBXhYI/AAAAAAAAACA/uClmg-ubze8/s1600-h/outdoor_2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/RquEeqBXhYI/AAAAAAAAACA/uClmg-ubze8/s400/outdoor_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5092309465883444610" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/RquEaqBXhXI/AAAAAAAAAB4/x6TeirsYcfg/s1600-h/outdoor_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/RquEaqBXhXI/AAAAAAAAAB4/x6TeirsYcfg/s400/outdoor_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5092309397163967858" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-3019171375347315992?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/3019171375347315992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=3019171375347315992' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/3019171375347315992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/3019171375347315992'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/07/outdoor-scenes.html' title='Outdoor scenes'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_GKvgMH3qkR0/RquEeqBXhYI/AAAAAAAAACA/uClmg-ubze8/s72-c/outdoor_2.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-7454819361399324254</id><published>2007-06-24T02:15:00.001-07:00</published><updated>2007-06-24T03:16:41.353-07:00</updated><title type='text'>GUI Continued</title><content type='html'>hi&lt;br /&gt;there is a lot of updates, the must important ones is: events and if expressions.&lt;br /&gt;here is the list of events supported by the system:&lt;br /&gt;onTime - Runs the event at T+&lt;time&gt; milliseconds.&lt;br /&gt;onMouseEnter - Runs the event when the mouse enters the window rectangle.&lt;br /&gt;onMouseExit - Runs the event when the mouse exits the window rectangle.&lt;br /&gt;onEnter - Runs this event when the user presses enter.&lt;br /&gt;onEnterRelease - Runs this event when the user lets go of the enter key.&lt;br /&gt;those events are must if you need to do some hover effects, or press/release button actions.&lt;br /&gt;&lt;br /&gt;if expression adds a lot of freedom when you want the gui stay small and responds to other gui variables, controls properties or game cvars.&lt;br /&gt;for example:&lt;br /&gt;windowDef Desktop&lt;br /&gt;{&lt;br /&gt;  rect 0, 0, 640, 480&lt;br /&gt;  background 0, 0, 0, 1&lt;br /&gt;  float    "fTest"    0&lt;br /&gt;  OnMouseEnter&lt;br /&gt;  {&lt;br /&gt;      if ("desktop::fTest" == 0)&lt;br /&gt;      {&lt;br /&gt;          background 0, 0, 0, 1 &lt;br /&gt;      }&lt;br /&gt;      if ("desktop::fTest" == 1)&lt;br /&gt;      {&lt;br /&gt;          background 1, 0, 0, 1 &lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;  OnEnter&lt;br /&gt;  {&lt;br /&gt;      set "desktop:fTest" "1"&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;this simple script creates desktop window with 680x480, black background and one variable called "fTest" (initialized to zero)&lt;br /&gt;when the mouse enters window rect it changes the background according to "fTest" value,&lt;br /&gt;because "fTest" is zero, the background will stay black everytime the mouse enters.&lt;br /&gt;when we press the enter key, "fTest" will set to one, and now if we move the mouse into window rect the background will change to red.&lt;br /&gt;&lt;br /&gt;i also added more controls:&lt;br /&gt;ChoichBox (choichDef) - A window that allows the user to toggle between a few different choices.&lt;br /&gt;ScrollBar (sliderDef) - The volume control is a scrollbar, as are the scroll bars in listbox windows.&lt;br /&gt;ListBox (listDef) - A window that displays a list of items. support multi column and alignment for each column.&lt;br /&gt;&lt;br /&gt;i added cvar property to few controls (editBox, scrollBar, choichBox), which is the cvar to attach to. It displays the value of the cvar, and changes the cvar when the user changes the value of the control.&lt;br /&gt;&lt;br /&gt;i also fix few issues with font scale rendering,&lt;br /&gt;id uses 3 sizes for each font type and store it in 3 files fontname_12/_24/_48.extension,&lt;br /&gt;the textscale property of the controls used to determine which font file we should use and in what scale to render the text.&lt;br /&gt;(1) if textscale less than or equal to 0.3 use font file with _12 (font size 12 pixels)&lt;br /&gt;(2) if textscale larger than 0.3 and 0.6 or less use font file with _24 (font size 24 pixels)&lt;br /&gt;(3) if textscale larger than 0.6 use font file with _48 (font size 48 pixels)&lt;br /&gt;after we know which file to use, we compute the render scale of the text we want to display, this is by checking the value of the textscale against the range it falls in, for example&lt;br /&gt;if textscale is 0.3 we know from (1) that we need to use font with size 12, and the render scale is 1.0 because the range of (1) is [0, 0.3] and 0.3 is 100% of this range.&lt;br /&gt;if textscale is 0.15 the render scale is 0.5 because 0.15 is 50% of this range.&lt;br /&gt;&lt;br /&gt;i also changed my font files generator tool to:&lt;br /&gt;Bitmap Font Generator v1.8c by Andreas Jצnsson (www.AngelCode.com)&lt;br /&gt;it take less space when using fonts with large sizes such as 24 and 48.&lt;br /&gt;this tool make sure every black area will be filled with the right character and not just putting the characters with equal distance between them, for example the characters '_' and '-' will take 2 areas of size 48 in the old tool, and with the new they take hardly one area, it basically compute character rectangle and fit it where he can by keeping track of empty and filled areas inside the texture.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/time&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-7454819361399324254?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/7454819361399324254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=7454819361399324254' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7454819361399324254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7454819361399324254'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/06/gui-continued.html' title='GUI Continued'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-2089979578896354707</id><published>2007-04-28T09:10:00.000-07:00</published><updated>2007-04-28T10:06:26.093-07:00</updated><title type='text'>More on GUI</title><content type='html'>hi&lt;br /&gt;in the last weeks, i was working on the gui, it is more complicated then i thought but i'm now supporting almost all the features. the best way to explain what this .gui file can do is by giving an example so here is one:&lt;br /&gt;windowDef Desktop&lt;br /&gt;{&lt;br /&gt;   rect    0,0,640,480&lt;br /&gt;   backcolor    0,0,0,1&lt;br /&gt;   visible    1&lt;br /&gt;   windowDef raven&lt;br /&gt;   {&lt;br /&gt;       rect    120,40,400,400&lt;br /&gt;       visible    1&lt;br /&gt;       background    "gfx/guis/mainmenu/raven_1"&lt;br /&gt;       matcolor    0,0,0,1&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;the system based on nested windows and events. there is one top level window called 'Desktop' then one or more windows that are 'children' of the desktop, then zero or more windows that are children of the children, etc... (every window/event has it own params)&lt;br /&gt;here we define the top must window 'Desktop' positioned at 0,0 with size of 640 n 480 (width and height), we set his background color to black and make sure he is visible.&lt;br /&gt;we then create a second window, which is child on desktop positioned at 120,40 with size 400,400, make sure this one also visible and also set his background image to some texture.&lt;br /&gt;'matcolor' is texture color, so here we set it to black so later we could create a transition effect so it fades in and out.&lt;br /&gt;the lines below define transitions on texture color of raven window (they should be inside 'Desktop' brackets)&lt;br /&gt; windowDef anim_credits&lt;br /&gt; {&lt;br /&gt;   rect    0,0,1,1&lt;br /&gt;   visible    1&lt;br /&gt;   notime    0&lt;br /&gt;&lt;br /&gt;   onTime 0 {&lt;br /&gt;       transition "raven::matcolor" "0,0,0,1" "0.839,1,0.658,1" "1000" ;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   onTime +3000 {&lt;br /&gt;       transition "raven::matcolor" "0.839,1,0.658,1" "0,0,0,1" "1000" ;&lt;br /&gt;   }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;ok, i said we could define some events so here we define the 'onTime' events which runs the actions/sets inside is brackets every T+&lt;time&gt; milliseconds, the timeline isnt static so we reset it with 'resetTime' command.&lt;br /&gt;inside the first 'onTime' we set new transition, t&lt;/time&gt;&lt;time&gt;ransition linearly interpolates a variable from one value to another over time (in milliseconds), so &lt;/time&gt;&lt;time&gt;what i do here is to interpolate between texture color of raven window from 0,0,0,1 to new color 0.839,1,0.658,1 over 1000 milliseconds (one second), after 4 second we create new transition which linearly interpolate between the new color to black. you can also define some local variables inside each window so instead of writing and duplicate certain values you could define some at first and use them later, for example: you can define those vectors as global by declaring them on 'Desktop'&lt;br /&gt; definevec4    "new_color"    0.839,1,0.658,1&lt;br /&gt; definevec4    "org_color"    0,0,0,1&lt;br /&gt;then you can write: &lt;/time&gt;&lt;br /&gt;&lt;time&gt;   windowDef anim_credits&lt;/time&gt;&lt;br /&gt;&lt;time&gt;   {&lt;br /&gt;   rect    0,0,1,1&lt;br /&gt;   visible    1&lt;br /&gt;   notime    0&lt;br /&gt; &lt;br /&gt;   onTime 0 {&lt;/time&gt;&lt;br /&gt;&lt;time&gt;        transition "raven::matcolor" "$desktop::org_color" "$desktop::new_color" "1000" ;&lt;br /&gt;   }&lt;br /&gt;&lt;/time&gt;&lt;br /&gt;&lt;time&gt;    onTime +3000 {&lt;br /&gt;       transition "raven::matcolor" "$desktop::new_color" "$desktop::org_color" "1000" ;&lt;br /&gt;   }&lt;br /&gt; }&lt;br /&gt;when you have a lot of transitions this is more readable and generic if you want to change the color to some other value, you just chang&lt;/time&gt;&lt;time&gt;e the variable value and the rest works fine.&lt;br /&gt;note the $ sign, this tells the system its a reference to some variable.&lt;br /&gt;ok, this was a crush course about some of the cool things you can do with .gui files.&lt;br /&gt;what i have left to do is some fixes here and there and also adding other events and controls such as sliders and lists.&lt;/time&gt;&lt;br /&gt;&lt;time&gt;here is some screen shots:&lt;br /&gt;&lt;br /&gt;&lt;/time&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_GKvgMH3qkR0/RjN9rBODjjI/AAAAAAAAABo/Kf-ZcPcNT3M/s1600-h/gui2_1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_GKvgMH3qkR0/RjN9rBODjjI/AAAAAAAAABo/Kf-ZcPcNT3M/s400/gui2_1.jpg" alt="" id="BLOGGER_PHOTO_ID_5058524984482434610" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_GKvgMH3qkR0/RjN9whODjkI/AAAAAAAAABw/GmJVYlOndvU/s1600-h/gui2_2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_GKvgMH3qkR0/RjN9whODjkI/AAAAAAAAABw/GmJVYlOndvU/s400/gui2_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5058525078971715138" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;time&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/time&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-2089979578896354707?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/2089979578896354707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=2089979578896354707' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2089979578896354707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2089979578896354707'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/04/more-on-gui.html' title='More on GUI'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_GKvgMH3qkR0/RjN9rBODjjI/AAAAAAAAABo/Kf-ZcPcNT3M/s72-c/gui2_1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-7026564634806749955</id><published>2007-04-07T10:40:00.000-07:00</published><updated>2007-04-07T10:59:20.546-07:00</updated><title type='text'>GUI files</title><content type='html'>hi&lt;br /&gt;this week i added GUI so i could use it for displaying hud/weapons ammo/power ups etc.&lt;br /&gt;id uses .gui files which basically a script that allows you to define elements to display on the gui such as windows/text boxs/images etc, you can also set there properties like rect, color, text, font and more - this is very easy and fast way to create GUI's.&lt;br /&gt;after you have the GUI script you can render the GUI on a 3d surface in the game.&lt;br /&gt;for example: you can use it to display player info like health, power ups (on 2d screen), or on 3d surface of a weapon to show ammo info.&lt;br /&gt;here is a screen shots of .gui files from id quake4 folder that i'm loading from my engine, for now its rendered on the screen, but next time i will show it inside the game.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;railgun.gui&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_GKvgMH3qkR0/RhfYlufpHgI/AAAAAAAAABg/6mlEG8Ct530/s1600-h/gui2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_GKvgMH3qkR0/RhfYlufpHgI/AAAAAAAAABg/6mlEG8Ct530/s400/gui2.jpg" alt="" id="BLOGGER_PHOTO_ID_5050743649766809090" border="0" /&gt;&lt;/a&gt;machinegun_inview_scope.gui&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_GKvgMH3qkR0/RhfYfufpHfI/AAAAAAAAABY/xPmy8XRBHms/s1600-h/gui1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_GKvgMH3qkR0/RhfYfufpHfI/AAAAAAAAABY/xPmy8XRBHms/s400/gui1.jpg" alt="" id="BLOGGER_PHOTO_ID_5050743546687593970" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-7026564634806749955?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/7026564634806749955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=7026564634806749955' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7026564634806749955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/7026564634806749955'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/04/gui-files.html' title='GUI files'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_GKvgMH3qkR0/RhfYlufpHgI/AAAAAAAAABg/6mlEG8Ct530/s72-c/gui2.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-9179360585845937316</id><published>2007-03-31T08:51:00.000-07:00</published><updated>2007-03-31T09:04:36.263-07:00</updated><title type='text'>Bitmap fonts</title><content type='html'>hi, long time i didnt post anything because i didnt had time to.&lt;br /&gt;after i return from my vacation in the far east, thailand - amazing country, i needed couple of weeks to return to the real world :)&lt;br /&gt;ok, now the weapons works fine, but in some weapons the ammo left should be rendered in specific place on the entity model.&lt;br /&gt;id defines something called entitygui shader for surfaces that should be display gui, so what i'm going to do is to support this cool thing.&lt;br /&gt;i'm supporting the shader definition, so now all surfaces with entitygui shaders suppose to render their gui on that surface (texture)&lt;br /&gt;i also added bitmap fonts, until now i use d3dxfont lib but it is not so fast and i cant render textured characters.&lt;br /&gt;to genrate font data i'm using: bitmap font builder by thom wetzel.&lt;br /&gt;next time i hope i will finish some gui controls.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-9179360585845937316?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/9179360585845937316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/9179360585845937316'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/03/bitmap-fonts.html' title='Bitmap fonts'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-2303476760412832297</id><published>2007-02-18T04:40:00.000-08:00</published><updated>2007-02-18T04:54:15.971-08:00</updated><title type='text'>Profiling stuff</title><content type='html'>hi&lt;br /&gt;i didin't have time to add new features, instead i run the game on few maps and do some profiling, and i saw that on some maps the fps drop down to 20-30 fps - what the...&lt;br /&gt;at first i thought its the rendering, but after checking the profiling data i saw its the bots update function, i checked it out and see its the skinning stuff :(&lt;br /&gt;well, in the beginning i wrote some slow functions just to make it work and now its coming back, so i think i will need to rewrite those functions and add some asm code.&lt;br /&gt;in the next 3/4 week i wont updating because i will be on vacation :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-2303476760412832297?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/2303476760412832297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=2303476760412832297' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2303476760412832297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/2303476760412832297'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/02/profiling-stuff.html' title='Profiling stuff'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1096533244660546051.post-9062367015754079983</id><published>2007-02-10T09:56:00.000-08:00</published><updated>2007-02-10T10:49:24.126-08:00</updated><title type='text'>First person mode and torso,legs synchronization</title><content type='html'>ok, first updates from last week. &lt;div&gt;&lt;div&gt;&lt;div&gt;i added synchronization with torso &amp; legs to allow the bots to aim at direction x and walk in other direction y, this is very important when the bots fight (because if the bot could not do that i will looks very robotic).&lt;/div&gt;&lt;div&gt;this week i added first person mode, which is better than third person if you need very accurate aiming, i also synchronize the animation with the third person mode so when you look at mirror you see yourself.&lt;/div&gt;&lt;div&gt;here is few screen shots:&lt;/div&gt;&lt;img id="BLOGGER_PHOTO_ID_5029976215570198770" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://bp0.blogger.com/_GKvgMH3qkR0/Rc4Qt9W5sPI/AAAAAAAAAAw/h707v0bT2RQ/s400/sync1.jpg" border="0" /&gt;&lt;img id="BLOGGER_PHOTO_ID_5029978783960641794" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://bp2.blogger.com/_GKvgMH3qkR0/Rc4TDdW5sQI/AAAAAAAAAA4/965_sfJBhFM/s400/firstperson1.jpg" border="0" /&gt;&lt;img id="BLOGGER_PHOTO_ID_5029978942874431762" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://bp3.blogger.com/_GKvgMH3qkR0/Rc4TMtW5sRI/AAAAAAAAABA/I50yHuXnN8Q/s400/firstperson2.jpg" border="0" /&gt; &lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1096533244660546051-9062367015754079983?l=orenk2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orenk2k.blogspot.com/feeds/9062367015754079983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1096533244660546051&amp;postID=9062367015754079983' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/9062367015754079983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1096533244660546051/posts/default/9062367015754079983'/><link rel='alternate' type='text/html' href='http://orenk2k.blogspot.com/2007/02/first-person-mode-and-torsolegs.html' title='First person mode and torso,legs synchronization'/><author><name>orenk2k</name><uri>http://www.blogger.com/profile/17368325567494358231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_GKvgMH3qkR0/Rc4Qt9W5sPI/AAAAAAAAAAw/h707v0bT2RQ/s72-c/sync1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
