游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2815|回复: 1

渲染目标层

[复制链接]

42

主题

140

帖子

203

积分

中级会员

Rank: 3Rank: 3

积分
203
发表于 2003-11-8 16:36:00 | 显示全部楼层 |阅读模式


Dim tex As Direct3DTexture8 '创建贴图主体
texDime = 512
Set tex = device.CreateTexture(texDime, texDime, 0, D3DUSAGE_RENDERTARGET, D3DFMT_R5G6B5, D3DPOOL_DEFAULT)
'创建渲染,模板表面,取得tex级别,这样对texSurf的改变就会反映到tex上

Dim texSurf As Direct3DSurface8
Dim stencilS As Direct3DSurface8

Set texSurf = tex.GetSurfaceLevel(0)
Set stencilS = device.CreateDepthStencilSurface(texDime, texDime, D3DFMT_D16, D3DMULTISAMPLE_NONE)
'取得dx默认的渲染,模板表面

Dim backBuffS As Direct3DSurface8 'superficie del backbuffer principale
Dim ZbuffS As Direct3DSurface8 'superficie del Zbuffer principale

Set backBuffS = device.GetRenderTarget
Set ZbuffS = device.GetDepthStencilSurface

'设置渲染目标表面

device.SetRenderTarget texSurf, stencilS, 0

......渲染飞机

'还原渲染目标表面

device.SetRenderTarget backBuffS, ZbuffS, 0

......渲染鸡蛋



 

sf_2003118163627.rar

57.57 KB, 下载次数:

9

主题

26

帖子

26

积分

注册会员

Rank: 2

积分
26
QQ
发表于 2003-11-11 12:54:00 | 显示全部楼层

Re:渲染目标层

好!!!!!很感谢a

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2025-2-24 03:45

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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