Please test my first shader test app!

Started by
37 comments, last by vincoof 19 years, 5 months ago
Quote:Original post by silvermace

that sounds like _alot_ of overkill, i use a 2pass seperable blur, 8 samples per pass, so 16 blur samples per pixel, and i render to a P-Buffer bound as a texture so there is no readback of the framebuffer (a main killer)

all in all, i only ever render the scene 2 times, 4 times if i want excesive visual quality, i never readback the framebuffer and everything is done on the GPU.

read the article on Gamasutra, excelent as it provides some PS/VS code to help you along.


Ok, yeah that does sound better. I'm thinking of the following:
1) Render the scene once.
2) glCopyTexSub.
3) Draw this to the pbuffer bound as a texture 2 times with a 8 sample blur. (I would also slightly up the contrast, lower the brightness with each draw here)
4) Draw this over what was drawn in step one with additive blending.

I think this would be as fast as possible and get everything I wish to do done. My only question is: Is there anyway to have glCopyTexSub2d create a texture 1/2 the height and width of my screen? If not I imagine I would have to render twice instead (which I would rather not do as I have a complex scene).


Advertisement
Quote:Original post by skow
I'm thinking of the following:
1) Render the scene once.
2) glCopyTexSub.
3) Draw this to the pbuffer bound as a texture 2 times with a 8 sample blur. (I would also slightly up the contrast, lower the brightness with each draw here)
4) Draw this over what was drawn in step one with additive blending.

you can still get rid of that glCopyTexSubImage, don't render to the frame buffer, its not needed, render directly to a PBuffer with sharedlists (so you can use textures etc.) you can use more than 1 pbuffer per app, its perfectly safe (just dont go overboard) i'm using 3 pbuffers to render my scene, but ist worth it because the GPU only has to render 2 passes and the scene is complete, this leaves alot more passes free to do stuff like shadow-volumnes etc.

the whole problem of non-identical screen dimensions can be avoided on nVidia hardware by using texRECT in CG and the NV_TEXTURE_RECTANGLE extension, on ATI hardware like mine, its not yet possible so to address this, you simply render the scene as a square but keep the aspect ratio as you usally would (around 1.333f) this squshes the scene into a sqaure viewport, the only problem is anti-aliasing, but since you're bluring the image, you can almost get away with it :)
"I am a donut! Ask not how many tris/batch, but rather how many batches/frame!" -- Matthias Wloka & Richard Huddy, (GDC, DirectX 9 Performance)

http://www.silvermace.com/ -- My personal website
Well I figure I would have to render that step 1 to the back buffer as I am then going to blend over it with step4.

Also, why not use the ARB_TEXTURE_RECTANGLE?

Thanks
Quote:Original post by skow
Well I figure I would have to render that step 1 to the back buffer as I am then going to blend over it with step4.

Also, why not use the ARB_TEXTURE_RECTANGLE?

Thanks


omfg, theres and ARB texrect extension :| ???
"I am a donut! Ask not how many tris/batch, but rather how many batches/frame!" -- Matthias Wloka & Richard Huddy, (GDC, DirectX 9 Performance)

http://www.silvermace.com/ -- My personal website
I get the loading screen, then it starts to load, then a window pops up and says "Couldn't fetch valid FP profile," then another window says "Ahh, crap, screwup...".

I'm running a 64 MB Radeon 9000 on a Dell Inspiron 600m, with 512 MB RAM. I'm using one of the more up-to-date Omega drivers.

-Gauvir_Mucca
Quote:Original post by silvermace
omfg, theres and ARB texrect extension :| ???


Indeed there is, although I'm yet to use it. I assume it works just like the NV one.

So I'm assuming I'll just have to choose from :
- using glCopyTexSub and draw the scene once and use glCopyTexSub and render to a reduced size pbuffer

or

- drawing it twice once at full size to the backbuffer and a second time to the pbuffer with viewport 1/2 the size?

Ideally I would like to just draw it once and have glCopyTexSub create a texture 1/2(height)x1/2(width) the size of the buffer. Is there any way this is possible?
why not use ARB_texture_non_power_of_two if you can (you need a fallback though), it uses a bit less memory than ARB_TEXTURE_RECTANGLE and it hs no real limitations.
Intel P4 2.8GHZ HT
Radeon 9800 Pro

[Fullscreen]
No fx: 340 fps.
fx: 70 fps.
The more you know, the more you know that you dont know.
Quote:Original post by skow
Quote:Original post by silvermace
omfg, theres and ARB texrect extension :| ???


Indeed there is, although I'm yet to use it. I assume it works just like the NV one.

Right. Taken from the spec :
Quote:Backwards Compatibility

This extension is semantically equivalent to EXT_texture_rectangle
and NV_texture_rectangle. The tokens, and name strings now refer
to ARB instead of EXT or NV. Enumerant values are unchanged.



Quote:Original post by lc_overlord
why not use ARB_texture_non_power_of_two if you can (you need a fallback though), it uses a bit less memory than ARB_TEXTURE_RECTANGLE and it hs no real limitations.

ARB_npot is supported by a very short range of graphics cards, namely the new generation (GeForce 6 and-the-like).

This topic is closed to new replies.

Advertisement