Deferred Engine Playground - download

Due to popular request I reimplemented the feature!

Yay!

I also implemented highly experimental screen space emissive materials

Plus some SSAO!

Let’s talk briefly about the “holograms”

With F1 you can cycle rendertargets, you can find the hologram rendertarget at 8th position or so.

You can change the rendering style with the console command g_HologramUseGauss true or not. If true it will use a gaussian blur to read from the hologram map.

In the assets I added a new material

hologramMaterial = CreateMaterial(Color.White, 0.2f, 1, null, null, null, null, null, MaterialEffect.MaterialTypes.Hologram, 1);

If you have a material with the type hologram it will only get rendered to the hologram texture.

To have materials project the hologram you need to set the materialtype to
MaterialEffect.MaterialTypes.ProjectHologram

In the assets class, where I load all my assets you can find the function ProcessHelmets(), where I assign specific material values to the submeshes of the helmet. You can see the visor uses ProjectHologram, while some outlines use Hologram, so they get incorporated.


Screen space emissive materials are inherently flawed but were a fun experiment.
Currently the limitation is that it doesn’t work with submeshes, basically it’s only good with a model with only 1 submesh. Change the objects material to have a type of MaterialEffect.MaterialTypes.Emissive to make it work.

g_Emissive … can change some properties.

new Console variables for ssao are also available, just type in ssao and see what’s there.

1 Like

Submeshes are now properly supported.

Hi
Do you know a good tool to generate pbr textures from albedo’s and normals other than substance which isnt free.
I m struggling with photoshop and loose a lot of time as i m not an artist
Other than that, impossible to get it working it fails on loading effects, but i have built them with monogamePT and rebuild in VS. Im using the latest dev version of mg win 7 + gt 620
Ill post the exact message of error when i arrive home in about 1h

there is minor problems Vector truncation etc. in shaders, which makes it throw warnings and not build (on the first try). I should fix that stuff. Regardless, it builds after the first fail, it ignores these warnings then, for me at least.

I’m not using the newest Monogame builds since they don’t work for me - I can’t load any effects, even if they contain almost nothing or are the base monogame ones. I’ve wasted countless hours on that, and there are several threads here that about that. Oh well.

I can’t recommend texturing programs apart from Substance Painter, I haven’t worked with anything else.

It builds under VS and PT, but when I start the app under VS, i get this error:


I’ll dig into it later after playin with my dog :slight_smile:

Yeah, that’s the same problem I have when I use newer MonoGame dev builds. I work on 3.6.0.187.

And many others.

I can’t say anything about that, I have no clue how the problem can be fixed. I can’t even build the Monogame source without getting the SharpDX exception for the base monogame shaders.

EDIT: Oh it seems there are some fixes, I need to try it out.

EDIT2: I reinstalled the newest monogame dev build but it still doesn’t work.

Thank you! The pictures look awesome!

Yesterday I fiddled around until I could load the sponza model in my little deferred rendering engine. I think some of the normals of the sponza model aren’t right, for example the ones of the floor. I vaguely remember correcting them in Blender, when I used it in my renderer.

So far I had no luck using the corrected version from the XNA 4.0 project, since it is in FBX format, but not the right one to use with Monogame. Unfortunately I could’t find the old *.blend file for re-exporting to a newer version of the FBX format.

It would be awesome to have a nice high quality test model like sponza, where loading is not so tedious.

My version works ok, it has some holes, but most of the normal stuff is good, I’m positive.

It’s .obj, but that’s not an issue obviously. The real issue is to have all the materials loaded, since the default monogame only loads diffuse.

Unfortunately I have troubles creating my own custom effects for importing since I can’t compile MonoGame source. It worked with an older version of the source, but I just stuck to the default for this one.

My bad, can’t find installer’s artifacts within teamcity in Package - Windows, seems to be too old :confused:
Where can I find this version elsewhere ?

Yes, sure it works. I just wanted to point the normals issue out, so in case someone encounters for example strange illumination on some parts of the model, it could be due to the normals not being correct (Had some trouble with this myself :slight_smile:)

Was interesting to see, how you handled loading the model with the right textures with string manipulation. Confused me a little bit at first :sweat_smile:

My solution to setup the right materials was to setup some dictionaries with mapping from meshname to texture2D for every mesh of the sponza model. As a default I just used the same material for all meshes and set the textures using the dictionaries (I think the material needed three textures diffuse/albedo, normal and specular). Only if the dictionary contained a mask texture (like for the plant meshes for example) I used another material for this.

You mean creating your own effects right inside the content pipeline, so the model gets loaded with everything already setup?

I think I will try to convert my version of sponza to a working format, I will post if I have luck with that :slight_smile:

yeah that’s the same way I do it, i basically check the name and then look if there are materials with _diff _ddn etc. endings matching that name.

@Alkher oh that sucks.
http://www.xup.in/dl,13054042/MonoGameSetup360187.zip/ here you go

@Kwyrky I’m currently working on a CustomPipeline: it allows setting effect onto a model at build time (gbuffer as of now), specify textures to apply or let it find them automatically. That’s the hardest part, as a designer will name it differently from another one: model_n.xxx, of model_normal_anything.xxx, model_nmp.xxx.
I have also integrated a normal texture generation if checked for models lacking this data. I may do the same for PBR support also, but the “automatic” way is not as accurate as by human hand. It’s just to avoid losing time. When my processor will be ready, I may put it on github.

@kosmonautgames, thanks, now it works :slight_smile: but my rig is a little too slow for these emissive+ssr, i get only 12fps. (i5 + gt620, 20Go RAM) while when emissive models are not in frustrum, I get a nice 50fps :wink:
Nonetheless, when I start the app, I get exceptions in the console’s output concerning sharpDX

Runs at 70 fps for me, but it’s really not optimized at all and basically a poor man’s pathtracing.

You can disable the models in the mainLogic Initialize if you want.

Or in console set g_EmissiveDraw to false

With L you can spawn new Point lights and with C you can rerender the base environment cube map.

ssao_Active to false also helps with performance obviously.

Oh interesting. I hope in the near future Monogame will also have a full replacement for the original XNA Content Pipeline. There are some classes not yet implemented as far as I know.

If there’s anything specific you’d like to see inplemented you should open an issue on GitHub :slight_smile:

Very nice!

I’ve been reading the comments, and it seems it’s still hard for a lot of “the community” to nail down shaders…
they seem to be slippery devils… Hopefully its just a learning curve bottle-neck on our end, and not down to technical issues.

Oh yeah, and whats a sponza? Suddenly my world is full of sponza everywhere!

Sponza was a model provided by crytek to test the crytek engine’s global illumination if i remember well and other nice effects with a complex architecture. There is also another model nowadays used by engines but i dont remember the name. San something…san michel ? San mario ? San miguel ?

Edit: it is san miguel: http://graphics.cs.williams.edu/data/meshes.xml

Lots of sponza on that page. Thanks :slight_smile:

here is the official download

and here is another download archive of high quality meshes one can use

http://graphics.cs.williams.edu/data/meshes.xml
and
http://www.cc.gatech.edu/projects/large_models/

They made this stuff available so every graphics engineer could have some high quality models to work with. The Bunny, Dragon and Monk - at least one of them is in every graphics paper - are high quality 3d scans and offered a mesh density which was really unusally high back in the day. So it got adopted.

In my case I went the dragon route, as you can see in some pictures.

Good News. Yesterday I did found the old *.blend file of the sponza model. It’s the original one from CryTek and I exported it to FBX 7.4 binary format. Model normals are corrected and I also removed any texture references from it. Loads fine with the Monogame content pipeline tool. Of course textures have to be applied to the model at runtime. If someone is interested in the model, let me know.

Model normals were wrong, because they were like the normals in the image (blue lines). They are pointing in direction of the corners of the cube, but they should point in direction of the faces. There was a shortcut I don’t remeber anymore. After using it, each vertex would then have three normals in this case.

Edit:
Found it! Select the mesh / model in Edit Mode. Then use the Edge Split modifier (CTRL + E). Result should look like in the following image.