From 2886bc35e7b023370a8b8d56d78e5335eee2eb98 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 16 Apr 2021 10:35:42 -0700 Subject: Add Hello world example. (#1797) --- examples/triangle/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 examples/triangle/README.md (limited to 'examples/triangle/README.md') diff --git a/examples/triangle/README.md b/examples/triangle/README.md new file mode 100644 index 000000000..ba377b8cb --- /dev/null +++ b/examples/triangle/README.md @@ -0,0 +1,12 @@ +Slang "Hello World" Example +=========================== + +The goal of this example is to demonstrate an almost minimal application that uses Slang for shading. + +The `shaders.slang` file contains simple vertex and fragment shader entry points. The shader code should compile as either Slang or HLSL code (that is, this example does not show off any new Slang language features). + +The `main.cpp` file contains the C++ application code, showing how to use the Slang API to load and compile the shader code to DirectX shader bytecode (DXBC). +The application perform rendering using the D3D11 API, through a platform and graphics API abstraction layer that is implemented in `tools/gfx`. +Note that this abstraction layer is *not* required in order to work with Slang, and it is just there to help us write example and test applications more conveniently. + +This example is not necessarily representative of best practices for integrating Slang into a production engine; the goal is merely to use the minimum amount of code possible to demonstrate a complete applicaiton that uses Slang. -- cgit v1.2.3