3D Programming: Fourth Chapter Hello,shaders

Source: Internet
Author: User

Fourth Chapter Hello,shaders

This chapter will write the first shaders. Introduces HLSL syntax, FX file format, data structure, and so on. By the end of this chapter, you will have the basics of studying graphic programming in depth.

Your-Shader

The Classic programming example is used when writing the first program in a new programming language hello,world! ", the program output is a line of text" hello,world! ”。 We abide by this time-honored tradition and write the first shader program "hello,shaders! , but this time the output is a fixed color rendering onto an object.

First, start the Nvidia FX composer and create a new project. Open the Assets Panel, right-click on the Materials icon, and select Add Material from New effect menu item. Then select HLSL FX in the Add Effect dialog box and click Next to go to the next step.

Figure 4.1 NVIDIA FX Composer Add Effect dialog box

In a dialog box, select the empty template and name it helloshader.fx (Figure 4.2).

Figure 4.2 NVIDIA FX Composer Select HLSL FX Template dialog box.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.