Tuesday, August 7, 2012

Fair Price For Cross Platform Video Solution?

Hi all

since my last post i'm working full power on publishing cross platform video solution.
first stage it will be:
1. pc
2. linux
3. mac
second stage will depend on sells so eventually i will add top consoles:
1. xbox 360 (future 720)
2. ps3
more platforms will be added based on customers requirements...

now for the important stuff: Pricing

from my last post you already know that it a pain in the butt to create such a solution and at the same time making it fast enough to run multiple hd videos at 30 fps game...

i'v added a poll at the top left corner so i could know what do you think:
YOUR VOTE COUNTS!
believe it or not, but your vote will have a HUGE influence on the price.
pool keywords:
indie = independence/independent
comm = commercial

so... if you have friends, colleague or people who might consider buying such a solution, get them here to vote...

thanks and cya.

Wednesday, May 30, 2012

Generic Video Solution for Games

Hi all

this time i will talk about the video in your game..
well, first i will say that this issue was back in my head for long time, but recently, after i talked with my friend who has to buy video solution for their game, it popped to my head again...
why is it so complicated to make video solution for games?
my friend answer was, if you are going to make a cross platform game, want real-time speed, alpha channel support then you don't have any alternatives but to buy bink.

for these who don't now, bink is a cross platform video solution developed by rad game tools, its fast and easy to use and the quality isn't so bad either.
so what's the problem you ask? well, the price! its too expensive, 8500$ per platform per game, yes yes you read this right.

so for example, if you are a small indie developer and you are going to make a windows and xbox360 game, you will have to pay 17,000$, that's a lot of money for indie! hell, its a lot of money period!.

besides, most of the games will need to play video only at the beginning of the game, for example, some game story video, hardware video (nvidia, havok, amd) etc.. and for that its a real pain that you need to pay that kind of money.

anyway, what else you can do? well, you can create you own video solution for both xbox360 and windows.
for windows: use windows vfw lib
for xbox360, use xmedia lib

but this will take time, and you will have to design some nice lib to have same functions in both windows and xbox360 for the same/different features you have in each platform, and that's if you have 2 platform, it gets really dirty for more.

in my experience, if you need to create your own video solution for the ps3, you are unlucky, in the past i created video solution for an in-game ads company, and i used libsail that comes with sony sdk to support video playing on the ps3, let me tell you that in one word: nightmare!

lets say you want to play videos without sounds, lets say for explosions, menus etc... and the sound comes from your sound system (that you already licensed) triggered sounds when needed.
well, you don't have any kind of solution for this one too... same problem as i said above.

so it turns out that you don't really have any generic video solution for you game, that doesn't rip your wallet...

so why don't we have anything other than bink for games you ask? well i can't really answer this question, as i'm asking it myself for some time.
i turn out that even if you think you have what it takes to write something like bink, it is very difficult to do that, thats because its not so easy, and there is a lot of patents around video/audio compression that you need to carefully walk around so you won't land on a mine.

so maybe you ask yourself, what all these words, i already know that, so don't walk on my wounds...

what if tell you that there is an alternative!
maybe not so complete unit as bink (not supporting all the platforms etc), but will support:
* popular platforms and will add new ones in time.
* alpha channel in videos
* real-time speed
* good compression ratio.

and the crazy thing about it, it won't cost 8500$ per platform per game!

so the real question is:
will you be interesting in such solution?
if so, please write a comment to this post and i appreciate if you could write what features you want in such solution, how much do you think it worth paying for etc..

thanks and stay tuned, cya

Thursday, May 10, 2012

Flying Camera

hi
quick update...
this time i added support for flying camera, or spline paths.
what this means, is that i can place path nodes inside the editor, and make the camera follow it.
the reason i add this 'not so important feature' is that i wanted a way to capture videos and not capture me walking inside the scene, so every time i change something i could use the same path and see the new look with the same angles/pos etc...
anyway, here is a video showing flying camera in my scene, enjoy!


Saturday, April 7, 2012

Another Bokeh Technique - RM Video

Hi all, just created a quick video of the new vs technique, compare it with the quality of the ps technique from the previous posts and see how good it is, as for the numbers, check out my comment from the prev pos, enjoy:



Another Bokeh Technique

hi all

last post i talked about bokeh effect done inside pixel shader using special bokeh kernel, this time i will talk about more generic technique for doing bokeh.
first lets talk about whats wasn't good in the pixel shader technique.
in my engine i say i have film dof effect, what this means is that i can set almost any size of kernel per pixel! this means i'm not suffering from depth difference and stuff like that.
i can set one pixel to be blurred by radius 5, and the next pixel beside by radius 100, without any artifacts... (as long i will not get crazy with kernel radius)

anyway, because the ps technique is some kind of blur technique, if i will inject it to my engine on top of my dof, it will 'erase' my 'perfect' blur technique, because it is a blur, but not smarter than what i already have.

so if you don't have any dof/blur solution yet, it will probably be good for you, if you have some kind of smart blur, it probably wont.

so is there any thing we can do to add bokeh effect without dx10,11?
yes there is...
on the last post i said few words about a technique to generate bokeh using vertex shader, here i will write some detail about it and show some images from the engine.

this new technique uses the vertex shader to generate bokeh sprites/billboards, the steps to do this is:
* create big vertex shader containing 4 vertices per pixel!, yes you are reading it correct, 4 vertices per pixel...
* inside vs, you generate the quad vertices based on some math, this math will actually use some circle of confusion values and your current image, so you can set bokeh color and size.
* inside ps, you just sample your bokeh texture, can be any shape you like, and use the color you output from the vs, to set its intensity etc.

technique pros:
* very easy to do
* support any bokeh shape
* dx9 hardware (shader model 3)
* work hand by hand with any dof/blur technique
* very fast

technique cons:
* takes lots of vertex memory (depends on your size)
* vertex shader heavy (basically not a problem as we are more ps heave than vs)
* can be slow if you won't filter them in a good way, you don't want to generate bokeh for every pixel in the screen, this can be nasty! i got blur screen on win 7 ;)

here is few screenshots (not compressed) from the engine that's shows it in action, you could also see the film dof effect with very large coc to enhanced the effect (kernel radius of 80 for far pixels)

orignal image (no dof, no bokeh)

film dof (no bokeh)

pentagonal bokeh

hexagonal bokeh

circle bokeh

star bokeh

that's it, very simple and very fast! cya until next time...

Thursday, March 29, 2012

Revisiting Lens Effect / Bokeh - Details

Hi
just finished doing another test with this technique, and even test it on my old card... and it rocks, can't wait to inject it to the engine (its still a render monkey tester).
anyway, someone asked for some details about this technique, so here is the post that i hope will clear few things.

let me start with example with steps:
* we have image A
* we want new image B (blurred)
* so we apply blur filter on A and get B
the tricky part is the blur filter.

if we want to apply simple blur, lets say we take 4 samples, so we will sample four locations around our current pixel and do some average to get our new pixel, this is the basic of blurring. in this example we say the kernel/radius size is 1, because we sample at distance of one pixel from our current pixel.

if we want to control the radius and make it more then 1 pixel, we could manually change our samples locations, but a better way would be to set our samples as directions/vectors from our current pixel to the sample location we would like to sample, so we could scale it and sample at larger distance from our current pixel.

some numbers to show what i mean:
if we have an image with 3x3 pixels, and we are at pixel (1,1), our absolute samples locations will be:
(0,0), (2,0) - top
(0,2), (2,2) - bottom
but when we convert these to directions, we get:
(-1,-1), (1,-1) - top
(-1,1), (1,1) - bottom

NOTE: these directions are simply added to our current pixel location to get the right sample location.
the directions format is better since it allows as to scale them and sample at larger distance and its keeps the code more generic.
keep in mind that these directions will be good for radius 1 or 2, larger values results in artifacts dues to not enough samples around our pixel.
to use large values, you want more samples, but more samples means more gpu power, so you want to find nice balance between quality and speed.

anyway, how could we get shape like blurs? like circles, squares, pentagon etc..
the same idea we did in the simple case, we create a set of directions that creates or match the shape we want and apply it, we need to use more samples so our shape will maintain its shape.

one thing you should know is that when you sample and gather pixels almost all the time you will apply some kind of weight on them so each pixel will have its contribution (you may not want that every pixel will have the same contribution...).

here is a new video with better quality that shows this technique in action.
the test uses 2 inputs to emulate simple depth of field effect:
* first input is color image of a really nice car :)
* second is CoC image that represent the circle of confusion which in turn will change our radius when we blur (created in photoshop to apply dof on specific areas in the image)



Wednesday, March 28, 2012

Revisiting Lens Effect / Bokeh

Hi all
this time i'm revisiting lens effect called bokeh.
last week a friend of mine asked me about my film dof effect, and he asked if i'm supporting bokeh effect, i told him that i used to do it with FFT and with dx11 i can do it better.
as i don't have dx11 card (i'v old geforce 240 gt with dx10.1) i can't do the effect like crytek and unreal samaritan demo.
so is there another technique to do it without dx11? well yes...
what we can do is to create a huge vertex buffer that contain quads, one quad per pixel, and inside the vertex shader we can place and size them as needed.
this technique will work on dx9 hw and should be done on half or quarter size render target because the hugh amount of vertices it required, this technique add as new feature to unreal engine.
i don't really like the idea of having huge VB per pixel, so can we do better?
i did simple test in render monkey and create a "pentagon filter" inside the pixel shader, i control the size via simple circle of confusion value just to test and see if its working.
the filter uses 30 samples per pixel and its very fast, not that i had the chance to test the VB technique, but its faster than crytek method which is very fill rate heavy.
anyway, here is a short movie that show this simple test i did, enjoy :)



Monday, March 5, 2012

The First Scene

Hi all

finally i got to the point that i can share some info about the first scene i'v been working on.
the scene is an abandon parking place which i designed all by myself.
here are few screenshots from the scene:

the scene is far from being complete, i need to add more models, fix textures for pipes/flares etc... but i wanted to share it and not keeping it in the dark as last time...
for now i'm working on new props to fill the scene with so it won't look too clean/empty.

some rendering highlights used (for these who interested):
1. hdr
2. film tone mapping
3. film depth of field
4. gamma & color correction
5. screen space AA
6. sun shafts
7. dynamic shadows (from all lights)
8. real time GI (color & ambient occlusion)
9. light flares

i would be glad to hear what do you think...
cya until next time