WIP Hex Engine – Camera Update Video [New Video]

I have been doing heaps of work on improving the UI, and on boring AI systems, so to take a break from all that I added a more comprehensive camera + screen shot system…



http://www.youtube.com/watch?v=-PsQqpK0MvM



The 5 screen shots taken during the video can be viewed at http://imgur.com/a/GUDSn.

All the added controls are on the mouse scroll wheel, press to change mode, reef on the wheel to change the value, it's vaguely like using the controls on a real camera.

I really cranked the blur amounts in the video because I figured it would get washed out and lost, it works heaps better when using more subtle values.

Basic description of the ui : http://i.imgur.com/WUmDC.png

Cheers
James
9 Likes

Awesome stuff man, your games are benchmarks for jME3 visuals, really :slight_smile:

This is insanely cool!

hehehe PaparazziAppState

Nice work !!

cheers :slight_smile:

This looks great!

@thetoucher: Camera + Lens +Tilt shift for real :stuck_out_tongue:

thats pretty kewl :slight_smile:

Your game looks awesome! :slight_smile:

Hey @thetoucher, for the love of the Tilt Shift (I’m a tilt-shift adicted guy)



I got a really nice (but not so fast) FocusBlur (as you saw in UDK :p) , I think It will definitely shine in your capture system, so take a look:



http://farm8.staticflickr.com/7046/6917094403_d14469ddb6_z.jpg



[java]

focusBlur.frag





uniform float size; // is the size of the blur bokeh

uniform float dx; // 1 / screen_width

uniform float dy; // 1 / screen_height

uniform sampler2D RT; // is your RenderTarget or your scene with alpha is depth.

// tweak it with focus range, and other things like you already done!

uniform sampler2D Blur0; // a blur gausian blur (or other method) version of the scene.

varying vec2 vTexCoord;





// FOCUS CALCULATION





// F

vec3 f(sampler2D tex, vec2 texcoord, float blurmoc, float stepx, float stepy)

{

vec4 color = 0;



vec4 c;



vec3 lc;



float l;



if (blurmoc < 0.1)

{

color.rgb = texture2D(tex, texcoord).rgb;

}

else

{

if (blurmoc < 100)

{

float stepnum = 12.000000;

float ay = -stepy * stepnum/2 + stepy/2;

float ax = -stepx * stepnum/2 + stepx/2;



float[30] l_mul =float[30](

0.981373 ,0.990196 ,0.990196

,0.924510 ,0.399020 ,1.000000

,1.000000 ,1.000000 ,1.000000

,0.264706 ,0.793137 ,1.000000

,1.000000 ,1.000000 ,1.000000

,0.572549 ,0.960784 ,1.000000

,1.000000 ,1.000000 ,1.000000

,0.839216 ,0.188235 ,0.860784

,1.000000 ,1.000000 ,0.781373

,0.129412 ,0.614706 ,0.585294);



for (int i = 0; i < 30; i++){

if ((i==4)||(i==10)||(i==16)||(i==22)||(i==28)){

ay += stepy * 2;

ax = -stepx * stepnum/2 + stepx/2;

} else {

ax += stepx * 2;

}



c = texture2D(tex, texcoord + vec2(ax, ay) * blurmoc);

l = 0.3 * c.r + 0.59 * c.g + 0.11 * c.b + 0.05;

l = (ll l_mul) * c.a;

color.rgb += c.rgb * l;

color.a += l;

}

}

else

{

//color = focus_blur1();

}



color.rgb /= color.a;

}



return color.rgb;

}



// MAIN

void main(void)

{

float blurmoc = texture2D(Blur0, vTexCoord.xy).a;



blurmoc *= size;



vec3 res;

res = f(RT, vTexCoord.xy, blurmoc, dx, dy);



gl_FragColor = vec4(res.rgb, 1);

}



[/java]



I have a RenderMonkey project here and I could share if you like!

( @mifth check this out :stuck_out_tongue: )

Hmmm… I thought he was just using the DepthOfFieldFilter that’s already a part of JME.



Is there something about it that doesn’t do what you want? It seems to make similar pictures to what you have but without the artifacts.

:roll: the bokeh are pentagons or hexagons now… My image and bokeh are so small sorry

And the lighter pixel is highlighted…



Is the same shader which used here

http://tweety3d.pl/index.php?language=en

http://tweety3d.pl/progs/2.jpg

Look pretty nice with some lensfare or highlight background

http://tweety3d.pl/progs/8.jpg

@pspeed is right, as aways, it was just basically a wrapper for the DepthOfFieldFilter .



thanks @atomix, you inspired me to work on an alternate filter this morning :slight_smile:

http://www.youtube.com/watch?v=jLy1shgWnac



- Physically Accurate DoF (with different camera sensor or film sizes)
- Focal Length and Aaperture Iris Diameter (f-stop)
- Bokeh
- Chromatic Aberration
- Auto focus

The 9 screen shots taken during the video can be seen at http://imgur.com/a/6HOoi
1 Like

@thetoucher :



super awesome man!



That shader is more advanced! … And how can you make extra quads for highlight details?

@atomix cheers mate… there are no extra quads? it’s all done in the pixel shader.

1 Like

@thetoucher





A big WOW for me in the morning for that



@thetoucher said:

@atomix cheers mate… there are no extra quads? it’s all done in the pixel shader.