社区
游戏开发
帖子详情
在D3D里面如何使用Render to Texture?
ChinaShrimp
2004-10-20 05:31:25
我知道在OpenGL可以生成一个float类型的pbuffer,然后将可以渲染到里面去,但是操作起来很复杂。我想D3D里肯定也能实现Render to Texture,而且据说用起来很方便,我想请问一下如何使用?另外我还想问的就是在D3D里面能否设置pbuffer中的数据类型(例如浮点型)?多谢!
...全文
124
3
打赏
收藏
在D3D里面如何使用Render to Texture?
我知道在OpenGL可以生成一个float类型的pbuffer,然后将可以渲染到里面去,但是操作起来很复杂。我想D3D里肯定也能实现Render to Texture,而且据说用起来很方便,我想请问一下如何使用?另外我还想问的就是在D3D里面能否设置pbuffer中的数据类型(例如浮点型)?多谢!
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
潘李亮
2004-10-24
打赏
举报
回复
SetRenderTarget.把一个纹理当作Surface.
seagate
2004-10-21
打赏
举报
回复
IDirect3DDevice9有个函数是SetRenderTarget。它能实现你要的功能。它有个参数是IDirect3DSurface9,可以作为存放的buffer。数据类型是创建这个surface时自己定的。
lly20000
2004-10-21
打赏
举报
回复
在D3D中可以通过d3dxsavetofile来保存当前的截图
D3DXSaveSurfaceToFile(file_name, D3DXIFF_JPG, frontbuf, NULL, NULL);
d
3d
11
Render
To
Text
ure, RTT
渲染到贴图,
使用
Render
To
Text
ure, RTT, 渲染到纹理的详细代码
D
3D
11_
Render
To2D
Text
ure
D
3D
11_
Render
To2D
Text
ure
D
3D
render
pipeline
This book describes the Direct
3D
graphics pipeline, from presentation of scene data to pixels appearing on the screen. The book is organized sequentially following the data °ow through the pipeline from the application to the image displayed on the monitor. Each major section of the pipeline is treated by a part of the book, with chapters and subsections detailing each discrete stage of the pipeline. This section summarizes the contents of the book. Part I begins with a review of basic concepts used in
3D
computer graphics and their representations in Direct
3D
. The IDirect
3D
9 interface is introduced and device selection is described. The IDirect
3D
Device9 interface is introduced and an overview of device methods and internal state is given. Finally, a basic framework is given for a 2D application. Chapter 1 begins with an overview of the entire book. A review is given of display technology and the important concept of gamma correction. The representation of color in Direct
3D
and the macros for manipulating color values are described. The relevant mathematics of vectors, geometry and matrices are reviewed and summarized. A summary of COM and the IUnknown interface is COM: Component Object Model given. Finally, the coding style conventions followed in this book are presented along with some useful C++ coding techniques. Chapter 2 describes the Direct
3D
object. Every application instantiates this object to select a device from those available. Available devices advertise their location in the Win32 virtual desktop and their capabilities to applications 34 CHAPTER 1. INTRODUCTION through the Direct
3D
object. Selecting a device from those available and exam- ining a device's capabilities are described. Multiple monitor considerations are also discussed. Chapter 3 describes the Direct
3D
device object which provides access to the
render
ing pipeline. The device is the interface an application will use most often and it has a large amount of internal state that controls every stage of the
render
ing pipeline. This chapter provides a high-level overview of the device and its associated internal state. Detailed discussion of the device state appears throughout the rest of the book. Chapter 4 describes the basic architecture of a typical Direct
3D
application. Every
3D
application can use 2D operations for manipulating frame bu®er con- tents directly. An application can run in full-screen or windowed modes and the di®erences are presented here. The handling of Windows messages and a ba- sic display processing loop are presented. At times it may be convenient to use GDI in a Direct
3D
application window and a method for mixing these two Win- dows subsystems is presented. Almost every full-screen application will want to use the cursor management provided by the device. Device color palettes and methods for gamma correction are presented. Part II describes the geometry processing portion of the graphics pipeline. The application delivers scene data to the pipeline in the form of geometric primitives. The pipeline processes the geometric primitives through a series of stages that results in pixels displayed on the monitor. This part describes the start of the pipeline where the processing of geometry takes place. Chapter 5 describes how to construct a scene representing the digital world that is imaged by the imaginary camera of the device. A scene consists of a collection of models drawn in sequence. Models are composed of a collection of graphic primitives. Graphic primitives are composed from streams of vertex and index data de¯ning the shape and appearance of objects in the scene. Vertices and indices are stored in resources created through the device. Chapter 6 covers vertex transformations, vertex blending and user-de¯ned clipping planes. With transformations, primitives can be positioned relative to each other in space. Vertex blending, also called \skinning", allows for smooth mesh interpolation. User-de¯ned clipping planes can be used to provide cut away views of primitives. Chapter 7 covers viewing with a virtual camera and projection onto the viewing plane which is displayed as pixels on the monitor. After modeling, objects are positioned relative to a camera. Objects are then projected from
3D
camera space into the viewing plane for conversion into 2D screen pixels. Chapter 8 describes the lighting of geometric primitives. The lighting model is introduced and the supported shading algorithms and light types are de- scribed. Chapter 9 covers programmable vertex shading. Programmable vertex shaders can process the vertex data streams with custom code, producing a single ver- tex that is used for rasterization. The vertex shading machine architecture and instruction set are presented. Part III covers the rasterization portion of the pipeline where geometry is1.1. OVERVIEW 5 converted to a series of pixels for display on the monitor. Geometric primitives are lit based on the lighting of their environment and their material properties. After light has been applied to a primitive, it is scan converted into pixels for processing into the frame bu®er.
Text
ures can be used to provide detailed surface appearance without extensive geometric modeling. Pixel shaders can be used to provide custom per-pixel appearance processing instead of the ¯xed- function pixel processing provided by the stock pipeline. Finally, the pixels generated from the scan conversion process are incorporated into the
render
target surface by the frame bu®er. Chapter 10 describes the scanline conversion of primitives into pixel frag- ments. Lighting and shading are used to process vertex positions and their associated data into a series of pixel fragments to be processed by the frame bu®er. Chapter 11 describes
text
ures and volumes.
Text
ures provide many e±cient per-pixel e®ects and can be used in a variety of manners. Volumes extend
text
ure images to three dimensions and can be used for a volumetric per-pixel
render
ing e®ects. Chapter 13 describes programmable pixel shaders. Programmable pixel shaders combine
text
ure map information and interpolated vertex information to produce a source pixel fragment. The pixel shading machine architecture and instruction set are presented. Chapter 14 describes how fragments are processed into the frame bu®er. After pixel shading, fragments are processed by the fog, alpha test, depth test, stencil test, alpha blending, dither, and color channel mask stages of the pipeline before being incorporated into the
render
target. A
render
target is presented for display on the monitor and video scan out. Part IV covers the D
3D
X utility library. D
3D
X provides an implementation of common operations used by Direct
3D
client programs. The code in D
3D
X consists entirely of client code and no system components. An application is free to reimplement the operations provided by D
3D
X, if necessary. Chapter 15 introduces D
3D
X and summarizes features not described else- where. Chapter 16 describes the abstract data types provided by D
3D
X. D
3D
X provides support for RGBA color, point, vector, plane, quaternion, and matrix data types. Chapter 17 describes the helper COM objects provided by D
3D
X. D
3D
X provides a matrix stack object to assist in
render
ing frame hierarchies, a font object to assist in the
render
ing of
text
, a sprite object to assist in the
render
ing of 2D images, an object to assist in
render
ing to a surface or an environment map and objects for the
render
ing of special e®ects. Chapter 19 describes the mesh objects provided by D
3D
X. The mesh objects provided by D
3D
X encompass
render
ing of indexed triangle lists as well as progressive meshes, mesh simpli¯cation and skinned meshes. Chapter 21 describes the X ¯le format with the ¯le extension .x. The X ¯le format provides for extensible hierarchical storage of data objects with object instancing.6 CHAPTER 1. INTRODUCTION Part V covers application level considerations. This part of the book de- scribes issues that are important to applications but aren't strictly part of the graphics pipeline. Debugging strategies for applications are presented. Almost all Direct
3D
applications will be concerned with performance; API related per- formance issues are discussed here. Finally, installation and deployment issues for Direct
3D
applications are discussed. Chapter 22 describes debugging strategies for Direct
3D
applications. This includes using the debug run-time for DirectX 9.0c, techniques for debugging full-screen applications and remote debugging. Chapter 23 covers application performance considerations. All real devices have limitations that a®ect performance. A general consideration of how the pipeline state a®ects performance is given. Chapter 24 covers application installation and setup. Appendix A provides a guided tour of the DirectX SDK materials.
D
3D
11直接渲染YUV
采取三纹理方式使D
3D
可以直接渲染YUV数据
D
3D
源码(VC 6)
Direct
3D
源代码
编写工具VC++ 6.0
游戏开发
8,325
社区成员
23,684
社区内容
发帖
与我相关
我的任务
游戏开发
游戏开发相关内容讨论专区
复制链接
扫一扫
分享
社区描述
游戏开发相关内容讨论专区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章