Create a rendertarget with more than one mip level, and you're done. If
there are mipmaps, the framework will automatically fill them for you
during the Resolve call.
We're thinking this is actually a driver bug. Apparently there is a
problem with some NVidia drivers where the StretchRect call that we use
internally is failing, but reporting success so we have no way of
detecting and working around the problem.
//part of fx file Out = tex2Dbias(DiffuseSampler, float4(In.TexCoord.xy, 0, 3));
and i get some thing that looks like like random (texture on this mip level is some random memory)
//------------------------ it work when i do it that way but its slower:
Texture2D Tex = new Texture2D(m_Game.GraphicsDevice, 1024, 1024, 1, ResourceUsage.AutoGenerateMipMap, SurfaceFormat.Color);
byte[] Data = new byte[1024*1024*4]; m_DrawBufferColor.GetTexture().GetData(Data); Tex.SetData(Data); m_HDREffect.Parameters["DiffuseTexture"].SetValue(Tex);
RenderTarget2D and MipMaps
Madix_t
dakota367
simon_
nattylife
and first mip map looks like this: [old link]
Davids Learning
m_DrawBufferColor = new RenderTarget2D(m_GraphicsDevice,
1024, 1024, 4, SurfaceFormat.Color, MultiSampleType.None, 0);
m_Game.GraphicsDevice.SetRenderTarget(0, m_DrawBufferColor);
//here i render
m_GraphicsDevice.ResolveRenderTarget(0);
m_GraphicsDevice.SetRenderTarget(0, null);
//now i use it
Texture2D Tex = m_DrawBufferColor.GetTexture();
m_HDREffect.Parameters["DiffuseTexture"].SetValue(Tex);
//part of fx file
Out = tex2Dbias(DiffuseSampler, float4(In.TexCoord.xy, 0, 3));
and i get some thing that looks like like random (texture on this mip level is some random memory)
//------------------------
it work when i do it that way but its slower:
Texture2D Tex = new Texture2D(m_Game.GraphicsDevice, 1024, 1024, 1,
ResourceUsage.AutoGenerateMipMap, SurfaceFormat.Color);
byte[] Data = new byte[1024*1024*4];
m_DrawBufferColor.GetTexture().GetData(Data);
Tex.SetData(Data);
m_HDREffect.Parameters["DiffuseTexture"].SetValue(Tex);
and now it work fine
//-------------------------
any sugestion what i do wrong
Angry Coder
Sarwanan
i have link to exe : [old link]
if you see many earth on black it mean that my comp/system is broken:)
if you see some thing else - its something with code.