我的github

FX Composer 2.5 Quick Tutorial[注意:FX Composer 2.5已停止更新。最新版名字叫Nsight Visual Studio]

Overview
This chapter presents a very short FX Composer 2.5 tutorial to quickly introduce you to several convenient and powerful new features. We highly recommend this tutorial, particularly if you have not worked with FX Composer 2 previously.

The NVIDIA Software Improvement Program
The first time you run a freshly installed FX Composer 2.5, you'll be prompted to join the NVIDIA Software Improvement Program (or SIP, which you can learn more about at http://developer.nvidia.com/object/SIP.html).
In summary, if you opt-in to the SIP, FX Composer will record which product features you're using, and we will use this information to make the product better. At no time is content of any kind (such as models/textures/shaders/scripts) sent to NVIDIA. We encourage you to opt-in, as you will be helping to guide future software improvements towards your usage scenarios.
The SIP also allows you to immediately send feedback to NVIDIA at any time by pressing F4. This will bring up an Instant Feedback dialog box where you can enter suggestions or bug reports.

Creating an Effect 创建一个特效
Next, you'll see FX Composer's Start Page. This page gives you convenient access to several commonly-used commands and resources.

接下来,你将会看到FX Composer的欢迎页面。这个页面给你几个常用的命令和资源的快捷方式。

Let’s start by creating a New Project.  You should always try to organize your projects so that all key assets (models, shaders, and textures) are in the same folder.  That way, you can easily ZIP up a folder to share your project with others.

你可以开始创建一个新的工程。您应该始终尝试组织项目,以便所有关键资源(模型、着色器和纹理)都位于同一文件夹中。这样,您可以轻松地将文件夹压缩,以便与其他人共享您的项目。

Name your project as you like, and choose a suitable location (the default location is My Documents/FX Composer 2).  A subfolder with the project name will be created. Once the project is created, you’ll see FX Composer’s default layout.
取一个你喜欢的名字,选一个合适的位置。该工程名的子文件夹将会被创建。一旦该工程创建了,你将会看到FX Composer的默认布局。
Let’s create a new effect.  Select the New Effect button on the main toolbar. A short wizard will pop up, guiding you through the creation of your new effect.
让我们创建一个特效。选择新建特效按钮。一个向导将会弹出,引导你创建你的新特效。

 The wizard will prompt you for the types of shaders you want to add.  Select HLSL FX and CgFX. Also, set the Effect Name as “Phong_Bump_Effect”, and set the Material Name to “Phong_Bump_ Material”.

向导将提示您输入要添加的着色器类型。选择HLSL FX和CgFX。此外,将“效果名称”设置为“Phong_Bump_Effect”,并将“材质名称”设置“Phong_Bump_Material”。

You may be wondering what the difference is between a material and an effect. An “effect” is a shader—for example, marble. A “material” is an instance of an effect with specific properties settings—for example, green marble. Materials are what you actually apply to objects in your scene.

你可能想知道材料和效果之间的区别。“效果”是着色器,例如大理石。“材质”是具有特定财产设置的效果实例,例如绿色大理石。材质是实际应用于场景中对象的材质。

The advantage of having effects and materials is that you can modify the underlying shader code of several materials at once if they are based on the same effect, simply by modifying the effect. Without a materials system, you would have to create separate shaders for each material variant and modify all of these shaders individually to achieve the same result.

具有效果和材质的优点是,如果多个材质基于相同的效果,则只需修改效果即可一次修改它们的基础着色器代码。如果没有材质系统,则必须为每个材质变量创建单独的着色器,并分别修改所有这些着色器以获得相同的结果。

Click Next.  You’ll now get a chance to pick from a variety of shader templates for the .fx shader effect.

单击“下一步”。现在您将有机会从各种着色器模板中选择.fx着色器效果。

Choose Phong Bump Reflect and click Next.  Then choose Phong Bump Reflect for the .cgfx file, and click Finish.

You’ll now see a sphere in the Materials panel, shaded using your new effect.

Importing Geometry
The next step is to create some geometry.  On the main toolbar, click on Import….  (This allows you to import geometry in various file formats, such as .fbx, .3ds, .obj, or .x.)
下一步是创建一些几何。在主菜单栏,点击Import...
In the file dialog box, choose:选择如下路径的轮胎obj
FX Composer 2/MEDIA/obj/tire.obj
You’ll see an additional prompt about importing materials.  Click OK
你将会看到一个额外的弹出向导,导入材料。点击OK。
You’ll now see a tire in the Render panel.  Use Alt + Leftmouse in the Render panel to get a better vantage point by rotating the view.  Shift + Leftmouse zooms in and out, and Ctrl + Leftmouse pans.
现在,您将在“渲染”面板中看到一个轮胎。在渲染面板中使用Alt+Leftmouse可通过旋转视图获得更好的有利位置。Shift+Leftmous可放大和缩小,Ctrl+Leftmouse可平移。
Let’s also create a sphere by clicking on the Create Sphere icon on the upper toolbar.  The sphere will appear at the world’s origin, so it happens to fit conveniently inside the tire. Make sure the Render panel’s Direct3D tab is active.
我们还可以通过单击上方工具栏上的“创建球体”图标来创建一个球体。该球体将显示在世界的原点,因此它恰好适合轮胎内部。确保“渲染”面板的Direct3D选项卡处于活动状态。
Applying Materials to Geometry 应用材质到几何体
Now it’s time to apply our material to our geometry.  To do this, simply drag‐and‐drop the Phong Bump Reflect material sphere from the Materials panel onto the tire, and then repeat the process for the sphere.
现在是时候将我们的材料应用于几何体了。为此,只需将“Phong凹凸反射”材质球体从“材质”面板拖放到轮胎上,然后对球体重复该过程。
Modifying Material Parameters 修改材料的参数
Click on the Phong Bump Reflect material sphere in the Materials panel. This will show the material’s properties in the Properties panel.
单击“材质”面板中的“Phong凹凸反射”材质球体。这将在“属性”面板中显示材质的属性。
Scroll down in the Properties panel until you see the Specular Power parameter.  Click on its value and change it to 7 either by using a slider or by typing in the value directly. You should see the Render panel updating dynamically as you change the parameter.
在“属性”面板中向下滚动,直到看到“镜面反射强度”参数。单击其值并使用滑块或直接键入值将其更改为7。您应该看到“渲染”面板在更改参数时动态更新。

Do the same for the Ambient Light parameter.  This is a color, so you’ll use FX Composer’s HDR color picker to pick a new color.  In the color picker, dragging sliders with the left mouse button will change their base (mantissa) values.  Dragging slides with the right mouse button changes their exponent. Make sure to use the left mouse button and drag the brightness slider (to the right of the color gamut) upwards.  Again, the Render panel will show all your changes applied to the scene in real‐time.

对环境光参数执行同样的操作。这是一种颜色,因此您将使用FX Composer的HDR颜色选择器来选择新颜色。在颜色选择器中,用鼠标左键拖动滑块将更改其基数(尾数)值。用鼠标右键拖动幻灯片将更改其指数。确保使用鼠标左键并向上拖动亮度滑块(色域右侧)。再次,“渲染”面板将实时显示应用于场景的所有更改。

Assigning Textures指定纹理
If you look through the list of parameters in the Properties panel, you’ll notice several textures: Diffuse Texture, Normal‐Map Texture, and Environment.  Let’s change the diffuse texture.
如果查看“属性”面板中的参数列表,您会注意到几个纹理:漫反射纹理、法线贴图纹理和环境。让我们更改漫反射纹理。
FX Composer has a Textures panel specifically for working with 2D, 3D, and cube map textures. View that panel by selecting Textures from the View menu.
FX Composer具有专门用于处理2D、3D和立方体贴图纹理的“纹理”面板。通过从“视图”菜单中选择“纹理”来查看该面板。
Now click on the Texture Panel toolbar’s “Add New Image” button ( ). It is worth noting that you can also drag and drop image files from Windows Explorer directly into the Texture Panel).
posted on 2023-03-03 11:33  XiaoNiuFeiTian  阅读(77)  评论(0编辑  收藏  举报