Jump to content

Rend2 - A Modern Renderer


Xycaleth

Recommended Posts

Posted

@@skew Great, another one who's interested in helping with the renderer. :D To the SSAO. The random function isn't the problem imo. If there would be blur applied to the rendered image it would look ok, i guess (thats what the "big" engines do, if i remember correctly). You could look in the ioquake3 repository for some enhancements. They reworked their ssao some months ago. https://github.com/ioquake/ioq3/commit/93e1feaaad19fcc97459b8fd15492b1ff3551bc3

 

Have you looked at the c code or only the glsl code? I could use some help with other effects if you are interested. I implemented some refraction prototype that could use some work to get the vanilla parity of this effect. E.g. the wobble effect is not implemented.

skew likes this
Posted

@@skew Great, another one who's interested in helping with the renderer. :D To the SSAO. The random function isn't the problem imo. If there would be blur applied to the rendered image it would look ok, i guess (thats what the "big" engines do, if i remember correctly). You could look in the ioquake3 repository for some enhancements. They reworked their ssao some months ago. https://github.com/ioquake/ioq3/commit/93e1feaaad19fcc97459b8fd15492b1ff3551bc3

 

Have you looked at the c code or only the glsl code? I could use some help with other effects if you are interested. I implemented some refraction prototype that could use some work to get the vanilla parity of this effect. E.g. the wobble effect is not implemented.

 

I do want to learn more about modern OpenGL so I'm interested in helping out with what little time I have :).  I started looking through the renderer source code to see how it was binding textures, providing data to the shaders, etc and generally walked through bits of it to get an understanding of the flow.

 

The mod I'm working on could really use a modern renderer, and is using the refraction with force push/pull, but also reflections, weather, and at least the SSAO.  Let me get past my next beta release in about a week and then I'll try to jump back into rend2.

 

EDIT: Thanks for the info re: ioq3. I was about to try that out to see if they evolved it any beyond the old rend2 used as a basis for the OpenJK version. Looks like the blur on the SSAO output is how most people make it look better.

Posted

Tried a Gaussian blur on the ssao result and it doesn't look too bad. Going to try a bilateral filter next because it's supposed to preserve edges better.

 

Without SSAO:

22CY64M.jpg

 

With SSAO + 2d Gaussian blur:

rzrdbwP.jpg

Posted

Hey skew. It's great to see you're trying out rend2 :) I don't think you'll get the results you want with a plain Gaussian blur. You will end up blurring across edges which ruins the effect. What you want is a depth-aware Gaussian blur which only takes samples across areas of continuity (i.e. not across edges). If have to say though, it's really difficult to notice the SSAO - I feel like something is wrong with it.

  • 4 weeks later...
Posted

Hey skew. It's great to see you're trying out rend2 :) I don't think you'll get the results you want with a plain Gaussian blur. You will end up blurring across edges which ruins the effect. What you want is a depth-aware Gaussian blur which only takes samples across areas of continuity (i.e. not across edges). If have to say though, it's really difficult to notice the SSAO - I feel like something is wrong with it.

I'm trying out a depth based blur now, and you're right that it was really difficult to notice.  I made a few changes and will post some shots soon.  Looks much more natural now.

 

I'm also working on getting post processing effects to properly show up in mirrors. Here is a test compositing them to the scene image rather than directly to the framebuffer if it's a mirror.  When I tried putting it directly to the framebuffer after rendering the portal surface, it never seems to persist in the framebuffer for some reason. Need to figure out why the colors seem off on the blur when compositing to tr.sceneImage though... format issue?

 

hddYUR0.jpg

 

EDIT: Also temporarily fixed the issue with the improper scissoring of mirrored surfaces (see previous screenshots) by temporarily disabling the scissoring, but this needs a proper fix.  From a cursory check, it looks like the mirrored surface is being split into multiple surfaces. It also looked like, since none of the vertices of the nearer surface are in the frustum, then it culls them entirely rather than checking if the surface exists in the frustum and clipping it to the view.  It was then calculating the scissoring coordinates from the remaining verts in clip space, which is only the further half of the mirror surface. I'm going to do more debugging on that to see what is exactly happening, but just another thing to eventually get right.

  • 1 month later...
  • 3 weeks later...
Posted

Something I'm curious about and I'm not sure if it's been mentioned. Would it be possible to use lower resolution textures on the LOD's? Like say for instance the lowest LOD uses a texture that's half the resolution as the main texture. Would that increase performance on a noticeable level or does the render engine stumble more with high polygon counts?

 

I've worked with other game engines that used low res textures but they also only had 1 other level of detail rather than 3+the high res model.

Posted

Mrwonko is right. Mipmaps are what you're describing except it's a bit more advanced than that. (And yes they are used). Lower resolution versions of the textures are chosen based on how many texels are being mapped to some area of the screen.

Posted

Not at the moment. Moved into a new apartment with some friends recently so my schedule's completely changed. I'll let you all know when I have something new to show :)

Tempust85 likes this
  • 4 weeks later...
Posted

No progress again still, but I've started writing up some documentation on roughly how rend2 is structured:

 

https://github.com/xycaleth/OpenJK/wiki/Rend2

 

Mainly aimed at anyone who is already familiar with graphics programming and may want to help. It will also help me because I'm always reminding myself "how does this work again?" every time I come back to it.

  • 1 month later...
Posted

I've already ported rend2 to SP for DF2 Mod. Still experimental, but seems to work as expected. Once MP rend2 is finished, I'll update DF2 mod's SP rend2 and then give the code to the main OpenJK project so it too can have an SP version.

 

Thank you so much! (:

Posted

Would be great if we could get rend2 MP updated from ioq3 rend2, it's really out of date. There's qsort stuff, shadowmap stuff, vao stuff, PBR cvar to toggle it and probably a lot more things.

Smoo likes this

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...