Randomchaos MG Samples

Tonight I have added some more to the Fire project, put in my old school fire too.




All from my archive blog:




Hope you find it useful :slight_smile:

3 Likes

Not checked in yet, but started to create a Deferred Lighting sample in my MonoGame repo. Looks like I have an issue with either calculating normals, or importing them :stuck_out_tongue:

If I do check it in today, it will not be ready, it’s still a work in progress :slight_smile:

1 Like

OK, coming together now, sorted my normal’s issue :slight_smile:


Might commit the first drop this afternoon :slight_smile:

1 Like

Just got shadow maps done too, just hope I can get it checked in today, I really should be working though :confused:

1 Like

Multi lights with multi shadows, soft and hard shadows shown here, just need to tidy the code and shaders up a bit now lol

2 Likes

Looks good! Are you planning to tackle point light shadows?

Yea, not sure how efficient they are though, as you are looking at a 6 way render per point light :confused:

You could update the shadow maps only if necessary.

It might be an option to go with paraboloid mapping which requires only two shadow maps but is a bit heavier to calculate and has other disadvantages like a visible seam in some cases.

1 Like

Ya i never could get parabolic shadow mapping to work right due to the seem which really is a deal breaker.
Would love to see a working example of that which is equivalent to a cubed shadow map.
.
.
.

Im gonna check this out when if i get a chance. looks succinct and in order.

Is that water just a quad with refraction or is that a actual model mesh warping under the vertice shader ?

Little bit more in there today, need to clock off in a bit though. Going to check it in, but please be aware this is a WIP :slight_smile:

1 Like

The water is a mesh, the wave function is done on the GPU. :slight_smile:

OK, checking this in, tidies the code up a bit and fixed a few tangent calcs in my primatives :slight_smile:



Hope you find it useful :smiley:

N.B. Not added point light shadows yet…

1 Like

So, was thinking about cross hatch shaders the other day and this morning found this articles for use with Unity, so just ported it to my samples repo :slight_smile:

I think I am going to take my material framework from my engine and put it in the samples so it makes doing this sort of stuff a little easier… may end up restructuring the samples all together lol

2 Likes

After reading @willmotil’s post here, I thought I might migrate a RTSP library I wrote to MonoGame, I guess you can do what you like with it, you may want to optomize the way I am loading the Texture2D, seems a little cumbersome, was easier in Unity, I could do a RawLoad from the IntPrt :confused:

Updated the RTSP streamer code as I found it had a memory leek in the unsafe bit. Hoping I fixed it anyway :smiley:

FYI,

Last night I added a FXAA post process to my Post Processing samples. The shader has been ported from a Unity tutorial I found here.

It’s not the final shader, it will need optomizing and Ill break it down in a tutorial at some point.

I have opened up one of the first Patron MonoGame tutorials I wrote last month to none Patrons. I may do this with other comunity posts as they age.


Sprite Batch Flag Shader Tutorial

1 Like


So, I had a message from someone wanting to implement my old XNA 4.0 instanced volumertic cloud sample in MonoGame. I have not looked at this code in an age, and not looked at instancing in MG yet.

Happy to say I now have it working in my sample code base, and ill be commiting it to the repo, here, later today :smiley:

2 Likes

That is a nice one :+1:

1 Like

OK, just updated the samples to work with MG 3.8. I have just added the existing source to the 3.8 projects as links, but all other samples going forward will be for 3.8 only.

As a recap of what’s in here:-
Samples created based on community questions here:

SpriteBatch flags.

Image displacement

Mesh rendering

AA Rectangle collision

Key frame sprite animation

Terrain Examples:-
Basic terrain

Geo Clip mapping


Ports of my Old XNA posts
Basic water

3D and old scehool fire



My light and shade series

Other sand box samples:-
2D Crepuscular (god) rays


Deferred ligjting with shadow maps

A full post processing framework

Ray picking

Clouds

So, a fair bit in there really, hope you guys find it useful :smiley:

All the MG 3.8+ code has a post fix of Core…

5 Likes