Deferred Engine Playground - download

Wanted to checkout the screenspace reflecions but in the current version there are some files missing:

JackJean.fbx, Stormtrooper.obj, Stormtrooper_Albedo.png, Stormtrooper_Metalness.png, Stormtrooper_Normal.png, Stormtrooper_Roughness.png.

thanks for the info, i updated that, the references were still in the content builder

1 Like

Thank you for updating. I’m looking forward to see the reflections in real time.

Checked it out. Looks really nice! :slight_smile:

I didn’t intend to go back to the reflections, but when starting on parallax occlusion mapping I noticed I could majorly improveme my algorithm.

The idea is that when I raymarch instead of accepting the latest “hit” i can interpolate based on the 2 depths I have red, I basically need to find the crosssection of the line between the depth values checked and the depth values red in the depth map. This is not as trivial as with POM, but it’s some basic linear algebra, so it was fun

Plus some other rules to disregard the pixel.

The improvements are visible, yet the problems are still apparent with the fairly low amount of samples tested - too many times does the object slip through the ray march testing and no

At least there are basically no false positives now in comparison to before.

The next step would be to optimize the ray marching itself, maybe make the steps sensitive to previous depth difference.

Plus I don’t reproject the screen right now, this would help in movement so the reflection doesn’t appear one frame behind any more.

Obviously if the surface is not 100% smooth these problems are very hard to spot, since the roughness of the material creates noise and therefore a pretty diverse set of inputs anyways.

1 Like

With temporal noise results can be super good. I don’t care for dynamic scenes yet so I’m ok with the limitations


I’ve added BEPU physics to the engine, just for fun. It also comes with arbitrary support for static meshes, which is nice.

It will also work with the dynamic re-shadowing etc. So if something stops moving it’s not rerendered, which is also nice.

So if you disable physics via p_Physics = false or when pressing space and going into editor mode you’ll get better framerate since not only does the CPU not have to worry about physics but your shadow maps don’t have to be updated every frame either. Which is nice.


This is Awesome @kosmonautgames … This is what I am trying with Bullet Physics… Great will check and let you know :slight_smile:

hi, i had go through ur rendering algorithm. Can you explain why you no ned to _graphicsDevice.SetRenderTargets(null); before using another multirendertarget binding? but u did set null for single rendertarget.

1 Like

that’s a mistake then, where in the Code is it?


thank you, I’m gonna fix that soon.

That happens when you think this part of the renderer is gonna be the last one and then you add additional features which come afterwards…

but, it seem like no different. set null or not.

Yeah it doesn’t matter since I change the SetRendertarget to something else later, it’s just the useless switching overhead

no spot light support yet?

I used to support them, in fact, they were the first lights to have shadow maps. But when I unified the shadow map generation I ditched them, unfortunately the legacy shader code is not on github (EDIT It actually is)

If you want I can reimplement them, but it’s basically the same as with normal point lights except you also have a direction and check the pixel-to-light-vector against that direction with a dot product. The threshold of the dot product determines the FOV of the light.

If you want to implement spotlights in your game/engine post a thread on the main page and we can make it work

1 Like[quote=“11110, post:128, topic:8180, full:true”]
hi, i had go through ur rendering algorithm. Can you explain why you no ned to _graphicsDevice.SetRenderTargets(null); before using another multirendertarget binding? but u did set null for single rendertarget.

Oh i misread that

I thought you meant I set it to null before calling another SetRenderTargets()

You don’t have to set it to null because that basically means to set the renderTarget to be the backbuffer.

So if I want to switch from Target 1 to target 2 I don’t have to




I can go directly from

SetRenderTarget(t1) to SetRenderTarget(t2)

It doesn’t matter if we have multiple rendertargets or a single one as far as I am aware

1 Like

Hi @kosmonautgames,

What sort of Co-ordinate system you followed in this Engine. How to change the co-ordinate system according to Physics Engine.

Thanks and Regards,

xy is ground, z positive is up

Thanks! Is it easier to change XZ as Ground and Y is positive up? How much time it takes? Is there in changes required in Shader side as well?

not a problem at all,

Just change camera.Up to (0,1,0); //In the mainLogic

Camera = new Camera(new Vector3(-80, 0, 20), new Vector3(1, 1, 0));
Camera.Up = Vector3.Up; //Vector3.UnitY

And in the original game file you’d want to change the gravity, to something like
space.ForceUpdater.Gravity = new BEPUutilities.Vector3(0,-9.81f,0);

I come from a terrain-oriented perspective, where XY are the basic values where everything is placed. So I got used to Z as the vertical component.