游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2749|回复: 5

怎样生成Render Target的Mipmap?

[复制链接]

6

主题

29

帖子

35

积分

注册会员

Rank: 2

积分
35
发表于 2008-10-30 17:00:00 | 显示全部楼层 |阅读模式
请问将场景渲染到纹理之后,怎样生成纹理的mipmap?
另外,怎样在在Shader中取指定mipmap层的颜色值?

我创建纹理的代码是
device->CreateTexture(width, height, 0, D3DUSAGE_RENDERTARGET, format,
               D3DPOOL_DEFAULT, &m_texture, NULL)

22

主题

309

帖子

353

积分

中级会员

Rank: 3Rank: 3

积分
353
QQ
发表于 2008-10-30 20:12:00 | 显示全部楼层

Re:怎样生成Render Target的Mipmap?

你不是生成了么...第3个参数控制...

Number of levels in the texture. If this is zero, Direct3D will generate all texture sublevels down to 1 by 1 pixels for hardware that supports mipmapped textures. Call IDirect3DBaseTexture9::GetLevelCount to see the number of levels generated.

6

主题

29

帖子

35

积分

注册会员

Rank: 2

积分
35
 楼主| 发表于 2008-10-30 22:50:00 | 显示全部楼层

Re:怎样生成Render Target的Mipmap?

但是我渲染到了纹理之后只有最顶层的surface是对的,其他层都是乱的。

89

主题

4036

帖子

4132

积分

论坛元老

Rank: 8Rank: 8

积分
4132
发表于 2008-10-31 11:40:00 | 显示全部楼层

Re:怎样生成Render Target的Mipmap?

GetSurfae(),多设置几个rendertaget,多绘制几遍。

19

主题

638

帖子

638

积分

高级会员

Rank: 4

积分
638
发表于 2008-10-31 18:57:00 | 显示全部楼层

Re:怎样生成Render Target的Mipmap?

see D3DUSAGE_AUTOGENMIPMAP
and corresponding device caps

35

主题

1735

帖子

1739

积分

金牌会员

Rank: 6Rank: 6

积分
1739
QQ
发表于 2008-11-2 10:23:00 | 显示全部楼层

Re: Re:怎样生成Render Target的Mipmap?

xpertsoft: Re:怎样生成Render Target的Mipmap?

GetSurfae(),多设置几个rendertaget,多绘制几遍。

老潘!! [em21]
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-21 00:31

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表