Lando
Založen: 29. 07. 2007 Příspěvky: 33 Bydliště: Cestice
|
Zaslal: 11. červen 2008, 12:13:24 Předmět: Render to texture neuklada nic pri vetsim rozliseni |
|
|
Ahoj. Po delsi dobe si zase nevim rady s problemem.
Pouzivam rendering do textury. Vsechno chodilo v pohode, az dokud jsem neupgradoval ovladace (forceware 93.71 -> 175.16 )
Od te chvile se mi do textury neulozi zhola nic, pokud ma velikost vetsi nez 256x256.
Grafika je GF7600GST.
Vytvoreni textur:
kód: |
tempBuffer3 = new Texture(device, this.width, this.height, 1, Usage.RenderTarget,
Format.A32B32G32R32F, Pool.Default);
buffer = new Texture(device, this.width, this.height, 1, Usage.Dynamic,
Format.A32B32G32R32F, Pool.SystemMemory);
|
Vykresleni:
kód: |
device.SetRenderTarget(0, output.GetSurfaceLevel(0));
device.Clear(ClearFlags.Target, Color.Gray, 0, 0);
device.RenderState.CullMode = Cull.None;
device.RenderState.ZBufferEnable = false;
device.VertexFormat = CustomVertex.TransformedTextured.Format;
CustomVertex.TransformedTextured[] verts = new CustomVertex.TransformedTextured[] {
new CustomVertex.TransformedTextured(0,0,0.3f,1,0,0),
new CustomVertex.TransformedTextured(width,0,0.3f,1,1,0),
new CustomVertex.TransformedTextured(0,height,0.3f,1,0,1),
new CustomVertex.TransformedTextured(width,0,0.3f,1,1,0),
new CustomVertex.TransformedTextured(width,height,0.3f,1,1,1),
new CustomVertex.TransformedTextured(0,height,0.3f,1,0,1)
};
device.BeginScene();
effect.Begin(FX.None);
effect.BeginPass(0);
device.DrawUserPrimitives(PrimitiveType.TriangleList, 2, verts);
effect.EndPass();
effect.End();
device.EndScene(); |
Stazeni do pameti:
kód: |
device.GetRenderTargetData(tempBuffer3.GetSurfaceLevel(0), buffer.GetSurfaceLevel(0));
GraphicsStream str = buffer.LockRectangle(0, LockFlags.DoNotWait);
float[, ,] data = (float[, ,])str.Read(typeof(float), new int[] { height, width, 4 });
buffer.UnlockRectangle(0); |
V pixel shaderu je jedina instrukce, ktera vrati konstantni barvu, ale pri vetsim rozliseni je vysledek vzdycky 0,5 zapsane pri Clearu
netusi nekdo v cem by mohl byt problem? Nebo aspon kde hledat?
Diky |
|