NecroDOME
12-08-2007, 02:08 AM
System: Windows XP, nVidia 6800 SLI
Compiler/IDE: Turbo Delphi
API: DirectX 9
Hi all,
Im rendering onto a render target texture, but nothing happens when the resolution of my screen is lower that the resolution of my render target.
For example: My render target is 512x512 and my screen resolution is 800x600 everything is fine. When I set my screen resolution to anything below 512x512 the render target does not get updated!
The rest of the scene what is NOT rendered to a render target is renderd correctly!
This is how I create my render target:
if Succeeded( Device.Screen.device.CreateTexture(FParam.Width, FParam.Height, FParam.MipMapCount,
D3DUSAGE_RENDERTARGET,
Necro3DFMTToD3DFMT(FParam.Format),
D3DPOOL_DEFAULT,
Texture,
nil) ) then
begin
Loaded := true;
end else
Loaded := false;
The begin-scene code: (the beginning when I try to render to my render target):
if Texture<>nil then
begin
FRenderTargetIndex := Index;
Device := TNecro3D_Device9( GetDevice );
Device.Screen.Device.GetRenderTarget(Index, FOldRenderTarget);
Texture.GetSurfaceLevel(0, FRenderTarget);
Device.Screen.Device.SetRenderTarget(Index, FRenderTarget);
Device.Screen.Device.BeginScene;
FCanRender := true;
end;
Comment: FCanRender is always true just for testing...
And this is called whenever I finish rendering to my render target:
if FCanRender then
begin
Device := TNecro3D_Device9( GetDevice );
Device.Screen.Device.EndScene;
Device.Screen.Device.SetRenderTarget(FRenderTarget Index, FOldRenderTarget);
FOldRenderTarget := nil;
FRenderTarget := nil;
end;
Compiler/IDE: Turbo Delphi
API: DirectX 9
Hi all,
Im rendering onto a render target texture, but nothing happens when the resolution of my screen is lower that the resolution of my render target.
For example: My render target is 512x512 and my screen resolution is 800x600 everything is fine. When I set my screen resolution to anything below 512x512 the render target does not get updated!
The rest of the scene what is NOT rendered to a render target is renderd correctly!
This is how I create my render target:
if Succeeded( Device.Screen.device.CreateTexture(FParam.Width, FParam.Height, FParam.MipMapCount,
D3DUSAGE_RENDERTARGET,
Necro3DFMTToD3DFMT(FParam.Format),
D3DPOOL_DEFAULT,
Texture,
nil) ) then
begin
Loaded := true;
end else
Loaded := false;
The begin-scene code: (the beginning when I try to render to my render target):
if Texture<>nil then
begin
FRenderTargetIndex := Index;
Device := TNecro3D_Device9( GetDevice );
Device.Screen.Device.GetRenderTarget(Index, FOldRenderTarget);
Texture.GetSurfaceLevel(0, FRenderTarget);
Device.Screen.Device.SetRenderTarget(Index, FRenderTarget);
Device.Screen.Device.BeginScene;
FCanRender := true;
end;
Comment: FCanRender is always true just for testing...
And this is called whenever I finish rendering to my render target:
if FCanRender then
begin
Device := TNecro3D_Device9( GetDevice );
Device.Screen.Device.EndScene;
Device.Screen.Device.SetRenderTarget(FRenderTarget Index, FOldRenderTarget);
FOldRenderTarget := nil;
FRenderTarget := nil;
end;