使用Render To Texture的AA问题
2012-06-07 16:49
471 查看
在项目中使用RTT,渲染场景到Texture时出现了锯齿严重的情况,创建设备时打开D3D的抗锯齿设置:
锯齿没有改善而且模型的纹理贴图出现了错误:
跟踪代码发现,由于使用
创建纹理,再使用 调用Device->GetSurfaceLevel(0, &SurfacePtr );获得Surface指针来创建RenderTarget。这样创建的纹理不能实现硬件AA。因此,改用
The creation of lockable, multisampled render targets is not supported.,关闭Lockable。AA成功。
m_d3dpp.MultiSampleType = D3DMULTISAMPLE_NONMASKABLE; m_d3dpp.MultiSampleQuality = D3DMULTISAMPLE_2_SAMPLES;
锯齿没有改善而且模型的纹理贴图出现了错误:
跟踪代码发现,由于使用
HRESULT CreateTexture( UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle );
创建纹理,再使用 调用Device->GetSurfaceLevel(0, &SurfacePtr );获得Surface指针来创建RenderTarget。这样创建的纹理不能实现硬件AA。因此,改用
HRESULT CreateRenderTarget( UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle );来创建RenderTarget,创建时MultiSample和MultisampleQuality参数来设置抗锯齿系数。RTT后,再StretchRect将surface拷贝到需要的纹理。操作时,CreateRenderTarget总是失败。最后查阅DXSDK发现:
The creation of lockable, multisampled render targets is not supported.,关闭Lockable。AA成功。
相关文章推荐
- Dot3 Bump Mapping和Render to texture遇到的一个问题
- 在使用 CCRenderTexture、shader 绘制几何图元时需要注意的一些细节问题
- 在使用 CCRenderTexture、shader 绘制几何图元时需要注意的一些细节问题
- 渲染到纹理(Render to texture):使用FrameBuffer
- 关于directshow播放器使用vmr9 renderless情况下创建设备的问题
- Render to Texture(渲染到纹理)
- 使用开源的PullToRefreshScrollView scrollTo和scrollby遇到的问题
- Linq to Sql中使用自定义枚举类型的奇怪问题
- 关于使用navicat for mysql在建立数据库连接时出现的2003 can't connect to mysql server on'localhost'(10038)问题
- 【ZYNQ_LINUX 】使用问题 invalid conversion from 'unsigned int' to 'unsigned char*' [-fpermissive]
- render to texture
- git使用中遇到的remote:Permission to xxx denied to xxx问题如何解决报错403找不到的问题
- SSH如何使用junit4进行单元测试,java.lang.IllegalStateException: Failed to load ApplicationContext 问题
- 解决使用PullToRefreshListView找不到setOnItemLongClickListener方法的问题
- 使用TextureView setTransform(Matrix)方法,解决Camera显示变形问题
- Render to Texture(渲染到纹理) [ZZ]
- 解决spring使用动态代理类型转换失败的问题--java.lang.ClassCastException: com.sun.proxy.$Proxy$ cannot be cast to ...
- 使用软引用解决Handler内存泄露和显示Popupwindow、Dialog时提示"Unable to add Window-token is null"的问题
- 【转贴】Render to Texture(渲染到纹理)
- Ogre使用CMake创建工程时,不能产生DirectX Render system项目的问题