![](https://img2023.cnblogs.com/blog/457232/202303/457232-20230303113221618-591302963.png)
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.
你可以开始创建一个新的工程。您应该始终尝试组织项目,以便所有关键资源(模型、着色器和纹理)都位于同一文件夹中。这样,您可以轻松地将文件夹压缩,以便与其他人共享您的项目。
![](https://img2023.cnblogs.com/blog/457232/202303/457232-20230303134729612-1689940580.png)
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.
![](https://img2023.cnblogs.com/blog/457232/202303/457232-20230304004414598-1934721963.png)
![](https://img2023.cnblogs.com/blog/457232/202303/457232-20230304005306020-1257849796.png)
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颜色选择器来选择新颜色。在颜色选择器中,用鼠标左键拖动滑块将更改其基数(尾数)值。用鼠标右键拖动幻灯片将更改其指数。确保使用鼠标左键并向上拖动亮度滑块(色域右侧)。再次,“渲染”面板将实时显示应用于场景的所有更改。