Please Test! render2texture & DDS CopySurface

Blitz3D Forums/Blitz3D Userlibs/Please Test! render2texture & DDS CopySurface

Tom(Posted 2006) [#1]
Hi all,

BACKUP IMPORTANT WORK BEFORE USING!

Here's a beta version of my Render 2 Texture and a new CopySurface() that works with .dds textures.

Sample source included, please post feedback/bugs and GFX card specs!!!

It requires you install a userlib. Unpack the DX7DLL_8thAug06 ZIP into Blitz3D\Userlibs\ (there should be dx7test.dll and dx7test.decls in there)

Sorry if you were using a previous version of this DLL and it messes up existing projects, but this version is a lot more refined (read: less hacky! :)

http://www.tomspeed.com/beta/

Notes: Blitting TO a DDS texture is slower than blitting to a normal texture, although blitting FROM DDS textures is quick.

CopySurface() works with regular Blitz3D textures too, though for some strange reason DX says blitting from a regular masked or Alpha B3D texture is unsupported (huh?)

Have fun and see if you can break the new functions!

Cheers
Tom


Mustang(Posted 2006) [#2]
GeForce 7800 GTX:


1 - Simple Render to Texture.bb
Worked! Fps 450-500+

2 - RT Performance.bb
Bombed! Got "Function 'createrendertexture' not found"

3 - EndGraphics.bb
Worked! Memory usage was constant after pressing "space" - which "reset" the scene perfectly. Mouse button stuff worked too.

4 - Using a quad mesh and RT for screen FX.bb
Worked! Took me a while to "get" what "space" does...


CopySurface DDS.bb
[edit] Worked! Duh... can I be so dum... after installing 1.97 it worked MUCH better :)


Tom(Posted 2006) [#3]
hehe yeh, 4 isn't obvious if the quad is perfectly lined up.

2 is my fault, I forgot to change references to CreateRenderTexture to UserRenderTexture in the source, I'll update it now :)


Boiled Sweets(Posted 2006) [#4]
This is a work machine not a 3D graphics monster but thought I'd try anyhow. I'll post a Radeon X1600 PRO report tonight.

1 - Simple Render to Texture.bb
35 FPS

2 - RT Performance.bb
<edit> 34 FPS

3 - EndGraphics.bb
35 FPS

4 - Using a quad mesh and RT for screen FX.bb
28 FPS

GFX: Intel 82865G


Phalastos(Posted 2006) [#5]
Hi Tom,

another great work!

1 - Simple Render to Texture.bb
Worked!

2 - RT Performance.bb
Worked!

3 - EndGraphics.bb
Worked!

4 - Using a quad mesh and RT for screen FX.bb
Worked!

CopySurface DDS.bb
Copy surface 1 brings texture errors
Copy surface 2 works fine!

Thank you for your hard work!

ATI Radeon 9100 64 MB VRAM / Win98se


puki(Posted 2006) [#6]
What's this stuff for? Is it purely for doing what we can already do, but with a DDS?


Boiled Sweets(Posted 2006) [#7]
You cannot currently render to a texture.


Tom(Posted 2006) [#8]
Puki: Normaly when you call RenderWorld() everything is drawn to the backbuffer, the backbuffer being a 'render target'.

Now, hardware permitting, you can create a texture that you can set as a render target, then when you call RenderWorld() it draws the scene directly to the texture.

If you had code that done this:

RenderWorld()
CopyRect 0,0,800,600,0,0,BackBuffer(),TextureBuffer(myTexture)

You could replace it with:
SetRenderTarget myTexture
RenderWorld()

It's a lot quicker


And CopySurface() is primarily if you want to copyrect using DDS textures, as Mark hasn't enabled it at this time.


puki(Posted 2006) [#9]
This thing seems to clash with vardx7 decls and dll so I removed them.

Right, looks like I am going to add in mirrors to Oblivion then - Bethesda didn't have mirrors.


t3K|Mac(Posted 2006) [#10]
Hi Tom,

1 - Simple Render to Texture.bb
796 FPS - runs fine.

2 - RT Performance.bb
270-814 FPS - runs fine too!

3 - EndGraphics.bb
Worked too!

4 - Using a quad mesh and RT for screen FX.bb
525-745 FPS. runs fine too!

CopySurface DDS.bb

Copy surface 1 brings artifact errors
Copy surface 2 works pretty fine.

Tom, i think you should teamup with BRL to kick B3D to its real limits!!


All tests performed on my work/game machine. details see sig.


t3K|Mac(Posted 2006) [#11]
oops, i found out that the old dx7dll works fine with EnableAnisotropic. The new one doesn't.


carpman(Posted 2006) [#12]
Radeon 9800 Pro 128 megs

1 - Simple Render to Texture.bb
280-310 FPS

2 - RT Performance.bb
280 FPS

3 - EndGraphics.bb
270 FPS

4 - Using a quad mesh and RT for screen FX.bb
200 FPS

CopySurface...worked fine on 2 but got some artifacts on 1

Great stuff...Thanks for all your hard work....now all I've got to do is to work out what I'm supposed to do with it!! :)

Pleased that Mustang has finally got what he wanted :)


Mustang(Posted 2006) [#13]

Pleased that Mustang has finally got what he wanted :)



:)) Last few days have been very good to me, can't deny that!

But there are still tangent space normalmaps and shadows (stencils, whatever) on my wishlist. After those I'm out of ideas... and can't blame the tools anymore for not finishing my game ;P


mongia2(Posted 2006) [#14]
nvidia 5700 256 mb

1 - Simple Render to Texture.bb
works

2 - RT Performance.bb
works

3 - EndGraphics.bb
works

4 - Using a quad mesh and RT for screen FX.bb
works

CopySurface...
works

mongia


fredborg(Posted 2006) [#15]
Hi,

All is working on the laptop, very cool!

For the EndGraphics thingie, you can use clearworld as well. Like this:



Boiled Sweets(Posted 2006) [#16]
1 - Simple Render to Texture.bb
310 FPS

2 - RT Performance.bb
286 FPS

3 - EndGraphics.bb
266 FPS

4 - Using a quad mesh and RT for screen FX.bb
206 FPS

Radeon X1600 PRO


degac(Posted 2006) [#17]
nvidia 6600GT 128Mb - Athlon64 3500+

1 - Simple Render to Texture.bb
486 FPS

2 - RT Performance.bb
449 - 565

3 - EndGraphics.bb
Ok

4 - Using a quad mesh and RT for screen FX.bb
Ok

CopySurface...
OK
Pressing 1 - 'real time' copy
Pressing 2 - a little lag - about .5 second

Great Job!


Mustang(Posted 2006) [#18]
Intel integrated 852/855 (laptop):


1 - Simple Render to Texture.bb
Worked! Fps 20 (debug on)

2 - RT Performance.bb
Worked!

3 - EndGraphics.bb
Worked!

4 - Using a quad mesh and RT for screen FX.bb
Worked!


CopySurface DDS.bb
Worked!


Tom(Posted 2006) [#19]
looking good!

Check my thread in Blitz3D programming for a cute bump mapping demo :)


puki(Posted 2006) [#20]
Okey-dokey.


puki(Posted 2006) [#21]
What thread?


Tom(Posted 2006) [#22]
I think I can make Blitz3Ds own environment maps renderable too, then you can bypass the copyrect step when doing realtime cubemaps.

Puki: Shhh!


puki(Posted 2006) [#23]
What about those stencil shadows you were working on? I need those too.


Trixx(Posted 2006) [#24]
All four examples worked OK on GF1 GTS 32 MB / P4 2.4 / 512MB / WIN XP

And... thanks Tom for all your efforts...


Tom(Posted 2006) [#25]
Cheers!


popcade(Posted 2006) [#26]
All fully working

GeForce FX5200, normally around 90 - 50FPS


Dock(Posted 2006) [#27]
Ati 9600 pro 128mb
P4 2.66ghz

everything works great :) nice work!


markcw(Posted 2006) [#28]
yes! yes! yes! yes! and yes! :)

ati radeon ve/win98se

ps: texture sizes over 1024 caused a MAV.


Dreamora(Posted 2006) [#29]
R2T Performance:

- 265 FPS windowed
- 430 FPS fullscreen

EndGraphics:

- Works, no problem here

Quad Mesh FX:

- 200-210 FPS windowed
- 295-305 FPS fullscreen

Textures at 2048 no problem (muk: thats no wonder, your card does not support more than 1024x1024)


System: Core Duo T2500, NVidia 7600 Go 256MB settings on max quality


PS: Amazing work ones again Tom :-)


Xaron(Posted 2008) [#30]
I'd need this, but the link is dead... Can anyone provide a download link for this please?

edit: Just discovered FastExt. :) ...

Thanks and regards - Xaron