Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 17 Jul 2011
Offline Last Active Jun 12 2013 12:43 AM

Posts I've Made

In Topic: Depth pre pass worth it ?

06 April 2013 - 09:08 AM

well I imagine each model would have a limited number of textures for it so as long as their not 1024x or bigger you could merge them into a big texture and have a UV offset as part of the instance, but this is limited by the texture size and count.
texture arrays I've had no experience with but this might be a good starting point,


I used his tutorials a while ago and they were fairly easy to follow, I'll og out on a limb and say this probably follows the trend, as for how useful they are, I've heard of them but again, I've never used them myself so I dont quite know.

And to put what I initially said in a nutshell, replace Diffuse and Specular Buffers with a MaterialID / UV Buffer and light the screen per material sampling the diffuse and specular from textures passed in by the material... that pretty much sums it up in a much less ballsed up way.

In Topic: Depth pre pass worth it ?

06 April 2013 - 08:38 AM

Materials with deferred?

how about an 8/16-bit(depending on your needs) MaterialID Buffer (to make room you can throw out Diffuse and Specular Buffer and replace then with UV's)
divide the screen into a 16x16 grid (or whatever size, fiddling with it you'd probably find a better resolution) of Partial Screen Quads,
in whatever way you see fit for each material fill a list of what cells contain it and fill each materials instance buffer.
for each shader, for each material that uses shader, set shader parameters from material and draw Partial Screen Quad by the materials instance buffer (I'm wording this like crap but I hope you understand)

in the shader which as well as the materials parameters has been passed the materials ID, if the pixel is not the current material return junk.
if the material is the right one, get the diffuse and specular via the texture the material passed and the UV buffer, normals you should have in a buffer so you dont have to transform the normals out of tangent space every time.
the rest should explain itself.

I've probably spoken gibberish or gotten something horribly broken, I've not tested this, it pretty much came to me on the spot.

In Topic: Deferred Ambient Light via CubeMap, Edge Artefacts

05 April 2013 - 04:57 AM

So I figured making another thread would be pointless as it'd likely die after 1 or 2 replies,
I'm adding SSAO and I have the random sample vectors transform their way to screen space UV's fine, but I need to rotate them randomly per pixel so I don't get the ambient occlusion looking like messed up shadows.
from what I understand I would transform the sample vector into the normals space, rotate its X and Y by sampling a noise texture and transform it back into world space, but how would I do this? (if anyone has a link to an article or something, that would be great, as this seams like something I would want to learn for later use too)

EDIT: I eventually found something for this, though the math is not firmly in my head as I'd like it, I have managed to make the rotation matrix and the AO is looking good now.

In Topic: Deferred Ambient Light via CubeMap, Edge Artefacts

04 April 2013 - 09:37 PM

well the sampler state is set, I just don't think it works on cubemaps properly, I've fiddled around and nothing I do changes this (possibly a limitation of XNA), which is a bit of a pain as I'd intended to stick to Shader Model 2 but I had to move to 3 in order to use texCUBElod.

In Topic: Deferred Ambient Light via CubeMap, Edge Artefacts

04 April 2013 - 07:17 AM

that did the trick nicely, thanks so much, I thought it was a problem sampling from the GBuffers and that the shader using texCUBE had nothing to do with it