

havok2
Members-
Posts
63 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by havok2
-
Hello, Mustang, very nice screenshots. I use Bokeh myself, because it comes closest to a real photo/video recording. But I think you could play around with the intensity a bit. Of course it is always an individual feeling, what looks nice and what doesn't. Therefore I always try to include the possibility to adjust the intensity myself. Depth of Field in the cockpit would be nice! Of course only very discreetly on the horizon. Soon I will slim down the code first and then I can have a look around in the files to see if I find something about it. Since many things are not documented and partly in Russian, I don't want to give false hopes at this point. Greetings.
- 79 replies
-
- depth of field
- mod
-
(and 5 more)
Tagged with:
-
Thanks diogofalcao, the engine can produce really nice effects, but unfortunately there are very few possibilities especially for replays. For example, there is no way to set the aperture, which is the main control for the depth of field. This is more or less hard coded and can be edited in the DOF.fx. Also concerning motionblur, there are no possibilities to vary it. Of course the focus is more on flying, but the basic camera functions should at least be implemented (correctly) =)
- 79 replies
-
- depth of field
- mod
-
(and 5 more)
Tagged with:
-
Update 24.05.2020: New Download Links in this Post Update 05.05.2020: Download Depth Of Field 2.0 OvGME Ready - Thanks Morpheus. Update 05.08.2020: Download Heatair V2.0 OvGME Ready Update 05.11.2020: Download MotionBlur V2.0 OvGME Ready Scientific article about Boke from Zeiss [GER] Hello pilots and modders, as an owner of a film company, a problem jumped right into my eye at DCS. For some reason (the reason is: ED uses Focal Length as well as Focal Distance and Distance for calculation. That is correct. But in DCS the zoom is not controlled by the focal length, but by the zoom - equivalent to a digital zoom. But this is not considered in the formula. Would be correct in reality, but nobody zooms this far lossless digitally and let's be honest - it doesn't look cool! And they missed the distance from the Camera to the Object to be noticed) the depth of field is not really calculated correctly. As you can see in the following picture, the background gets blurred the more you increase the focal length or simply zoom in. This is true for the same aperture, of course. But currently it looks like this in DCS. (v2.5.5) Wide Normal Tele Furthermore, the further you are away from the object, the less blurred the background becomes. At this point I am really a filmmaker and not a mathematician or full-time programmer. However, with my rudimentary knowledge and a lot of time of reverse code reading I have been working on the DOF.fx. You can find it here: *DCS Installation Path*\Bazar\shaders\PostEffects\DOF.fx The formula used here is obviously correct focalWidth * abs(focalDistance-dist)/dist but various parameters seem to be identical all the time especially the focalDistance and focalWidth where the latter should be called focalLength. Therefore the maximum blur does not change when zooming, nor when changing the distance to the object. Even worse. It has the effect that the image becomes sharper when zooming in. Simply because you have more image and details at the same bokeh. First of all I tried to transfer the real values from the camera into the formula. For this purpose I read out the zoom, the target point of the camera as well as the camera position, because these values seem to remain always the same in the current DOF.fx of DCS. Strangely enough I had to leave the value focalDistance in the formula anyway. So my calculation is still far away from perfection. Unfortunately, without debugging I don't know what values and value ranges DCS spits out here. So I had to test a lot with try and error. I have edited the following lines and tried to correct the incorrect calculation. At the beginning #include "../common/samplers11.hlsl" #include "../common/states11.hlsl" #include "common/context.hlsl" //added to get access to some camera values out of the game then the function of getBlurFactor float getBlurFactor(float dist) { //get game camera values float near = gNearFarFovZoom.x; //get nearest point rendered float far = gNearFarFovZoom.y; //get farest point rendered float zoom = gNearFarFovZoom.w; //get fov value of the camera float3 camOrigin = gOrigin; //get camera origin float3 camPosition = gCameraPos; //get camera pos //calculations float focalLength = 1/zoom; //it looks like the zoom is defined from 0.0 - 1.0 where 0 is the largest zoom - with more zoom you get more bokeh - simply inverted that thing and called it like what it is in our context float clipminmax = far-near; //calc the distance between clipping - that is normaly the range where the depth map is calculated and I think the dist value is something between 0.0-1.0 float3 d = camOrigin-camPosition; //calc absolut values of x,y,z - distance float cameraDistance = sqrt((d.x * d.x)+(d.y * d.y)+(d.z * d.z)); //calc absolut direct distance aka focalDistance (Pythagorean theorem) cameraDistance = 1/clipminmax*cameraDistance; //remap the distance to something like 0.0-1.0 float aperture = 2.8;//the standard blur looks like aperture 1 - this multiplier reduces the heavy blur (https://en.wikipedia.org/wiki/Aperture) aperture = aperture*aperture; //calc the size of the bokeh with this aperture. The aperture² gives you the ammount of reducing light. Also its the ammount the bokeh decreases. For example 1 = 1. Maximum Bokeh. At Aperture 1.4 you have the half ammount of light and the half size of bokeh. //output return focalLength * abs(cameraDistance + focalDistance - dist)/dist/aperture; //default -> focalWidth * abs(focalDistance-dist)/dist; | I cannot delete focalDistance, then you see extreme blur. In theory that means that my calculation of cameraDistance is wrong. I'm pretty sure it is, but hey at this moment it works. } float getRadius(float2 uv) { #ifdef MSAA float depth = DepthMap.Load(uint2(uv*dims), 0).r; #else float depth = DepthMap.Load(uint3(uv*dims, 0)).r; #endif float4 p = mul(float4(uv*2-1, depth, 1), invProj); float f = getBlurFactor(p.z/p.w); return pow(f, 1.5); //does the boke effect really grow exponentially with distance? - but this does enlarge the area where it is sharp. Default 1.5. } and then something for the performance here #define GOLDEN_ANGLE 2.39996323 #define NUMBER 150.0 #define ITERATIONS_STEP 8 //increasing this value means more fps because of less calculations. But also the look is different. Less iterations creates smaller bokeh. There is something in the loop down. Maybe in it could prevent. #define ITERATIONS (GOLDEN_ANGLE * NUMBER) // This creates the 2D offset for the next point. // (r-1.0) is the equivalent to sqrt(0, 1, 2, 3...) float2 Sample(in float theta, inout float r) { r += 1.0 / r; return (r-1.0) * float2(cos(theta), sin(theta)) * .06; } float3 Bokeh(Texture2D tex, float2 uv, float radius, float amount) { float3 acc = float3(0,0,0); float3 div = float3(0,0,0); float2 pixel = float2(aspect, 1.0) * radius * .025; float r = 1.0; for (float j = 0.0; j < ITERATIONS; j += ITERATIONS_STEP) { //using here ITERATIONS_STEP instead of GOLDEN_ANGLE float2 s = Sample(j, r); float2 tuv = uv + pixel * s; // rebuild tuv float nr = min(getRadius(tuv), radius); tuv = uv + pixel * s * (nr/radius); float3 col = tex.Sample(ClampLinearSampler, tuv).rgb; float3 bokeh = float3(5.0, 5.0, 5.0) + pow(col, 9.0) * amount; acc += col * bokeh; div += bokeh; } return acc / div; } The code can be optimized for all cases, but is easier to understand at this stage! This is how it looks like after my tuning. Wide Normal Tele and... Wide Normal Tele I would be glad about feedback and further developments to make DCS even more beautiful. Best greetings from Germany!
- 79 replies
-
- 5
-
-
-
- depth of field
- mod
-
(and 5 more)
Tagged with:
-
30th of May Hey, pilots, I check Steam every day to see if my pre-order has already been downloaded. Now I have seen that if you look for DCS Supercarrier in Steam the 30th of May 2020 is listed. Possibly the new release?
-
„As a side project, VRK now supports Leap Motion for hands integration. SteamVR users will find a new installer in the VRK zip that will install the driver, Oculus users should enable the hands emulation in the profile. See the Quick Start Guide for more details.“ Scheint so als wäre der Treiber für die Controller-Emulation Teil des VRK Projektes. Ob es jetzt auch über die Notizen des Klemmbretts hinaus funktioniert wird wirklich nicht eindeutig erklärt, scheint aber so. Sobald ich meine Brille habe, werde ich berichten! Vielen Dank für den Tipp.
-
Leap Motion mit Index VR (Emulator) Hey Piloten, ich warte immer noch sehnsüchtig auf meine vor Monaten bestellte Valve Index, jedoch ist meine Leap Motion bereits angekommen. Ich habe gesehen, dass jemand aus dem Fourm ein DCLeap Plugin entwickelt: https://www.digitalcombatsimulator.com/de/files/3306533/. Er wolle wohl auch bald ein Update bringen, wenn das Carrier Update da ist. Ich habe nun aber auch gesehen, dass es einen kompletten Emulator der Valve Index Handheld Controller gibt. Werden diese schon komplett von DCS unterstütz? Wenn ja sollte das doch mit Leap Motion wie hier im Video gezeigt: butterweich von der Hand gehen. Gibt es jemanden, der Erfahrungen dazu hat? Habe mir extra einen Micro USB zu USB Adapter gekauft um das Gerät in diese Vertiefung an der Index zu montieren. Bin so gespannt die F-18 damit zu fliegen. :joystick: Danke euch!