Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / PointSprite DirectX and GDK

Author
Message
silken
20
Years of Service
User Offline
Joined: 13th May 2004
Location:
Posted: 19th Dec 2010 17:24 Edited at: 21st Dec 2010 00:31
Hi,

for more Performance, I test a Render Point sprite with DirectX and GDK with the sample 3D POINT/3DLINE found in the forum.

I Thinked all was Ok, but when i want make another camera and Capture the image with SetCameraToimage , the Camera not see my particles.

have you Idea , how i can do for the camera See the DirectX particles? Because I think All objet make with direct with my exemple, is see on the screen, but not really by the GDK camera.


50 000 Particles with 558Fps on ATI HD5870

ScreenShot and Project Attached:

thx for Help

Project:
A-S-D key for move camera & Mouse
Press Spacekey to view CameraImage and particles not seen by camera




Main.cpp


3d3func.cpp


d3dfunc.h
[img][URL=http://img232.imageshack.us/i/particles.jpg/]

Attachments

Login to view attachments
silken
20
Years of Service
User Offline
Joined: 13th May 2004
Location:
Posted: 20th Dec 2010 01:28
I tink i have solution with ;

dbGetImagePointer(1)->GetSurfaceLevel(0, &destSurface);

during loop:
g_pd3dDevice->GetRenderTarget(0, &originalRenderTarget);
g_pd3dDevice->SetRenderTarget( 0,&destSurface);


And after the sync camera 1 a repass the SetrenderTarget to the original:

g_pd3dDevice->SetRenderTarget(0, originalRenderTarget);

I'll try this.
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 20th Dec 2010 02:59
I actually remember playing with SetCameraToImage a while ago. In your code you have only used it once before the while loop. Before you actually display your image on the screen you have to call the SetCameraToImage to render the view to the images buffer.

Warning! May contain Nuts!
silken
20
Years of Service
User Offline
Joined: 13th May 2004
Location:
Posted: 21st Dec 2010 00:29 Edited at: 21st Dec 2010 00:36
I tried to set Render Target.

The Particles was seen By the Camera 1 but the particles was under
the sphere. I think it's a Zbuffer Prob.. It seem to be the particles are draw after the sphere.

I dont know how to Get the Camera Image Good like the Camera 0


The project attach to file with exe compiled and Screen of the probleme.

I think Mista Wilson Has Maybe a solution.. but I can't send it a message by forum..


[img]

Main.cpp


d3dfunc.cpp


d3dfunc.h

Attachments

Login to view attachments
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 21st Dec 2010 01:57 Edited at: 21st Dec 2010 02:49
I've not used much d3d programming before, only for testing but I did notice in your main loop you have 2 uses of BeginScene and EndScene. Plus the second use if after the dbSync(). I'll download it and see what I can do with it.

EDIT: I'm assuming so far it's only grabbing RGB data and not ARGB. Just nosing through the D3D library.

I also cut the amount of syncs down but I'm still getting perfect for camera 0 and green for camera 1 too. Argh!!! I see where you're going with this and it's something I'll be using very soon on my next project.

Warning! May contain Nuts!
silken
20
Years of Service
User Offline
Joined: 13th May 2004
Location:
Posted: 21st Dec 2010 09:56
thank for Help..

I know the code was not very perfectly, because it's the firt time i'll try to use D3D.. and i 'll try lots of things to succeed, so they are quite a mistake I think..

I try to Capture the Scene with particles.. because I want to use shader Post FX with Quad and Image camera..

So if the particle was not correctly seen by the Camera 1.. it' Dead..
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 21st Dec 2010 16:04
The only other way I got it working was to position the camera then render it to the image then reposition the camera then render it to the screen. When I last used it I was using a second camera and it was working but this time just green. Rendering to an image take up fps rates anyway but so far no good. I'm gonna have a play about with it today see what I come up with and if I get the same results. I won't be using d3d though for my initial tests.

Warning! May contain Nuts!

Login to post a reply

Server time is: 2024-09-28 14:04:42
Your offset time is: 2024-09-28 14:04:42