This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository Direct3D.wiki.
View the commit online.
commit 8273bdf53abb55a929bd4b84fb29fc81b1bb872d
Author: Vincent Torri <vincent.to...@gmail.com>
AuthorDate: Fri Aug 18 22:55:53 2023 -0700
Update 'Direct3D 11 for 2D: Display a pink triangle'
---
Direct3D-11-for-2D%3A-Display-a-pink-triangle.md | 42 +++++++++++++-----------
1 file changed, 22 insertions(+), 20 deletions(-)
diff --git a/Direct3D-11-for-2D%3A-Display-a-pink-triangle.md b/Direct3D-11-for-2D%3A-Display-a-pink-triangle.md
index bd07111..9c67e28 100644
--- a/Direct3D-11-for-2D%3A-Display-a-pink-triangle.md
+++ b/Direct3D-11-for-2D%3A-Display-a-pink-triangle.md
@@ -1257,6 +1257,12 @@ struct ps_input
float4 position : SV_POSITION;
};
+/*
+ * vertex shater program
+ *
+ * @param input the 2 coordinates of a pixel, got from CPU
+ * @return the 4D position of the normalized coordinates of the vertex in GPU
+ */
ps_input main_vs(vs_input input )
{
ps_input output;
@@ -1269,6 +1275,12 @@ ps_input main_vs(vs_input input )
return output;
}
+/*
+ * pixel shater program
+ *
+ * @param input the 4D coordinates of a pixel
+ * @return the color of the pixel in RGBA colorspace, here pink
+ */
float4 main_ps(ps_input input) : SV_TARGET
{
return float4(1.0f, 0.0f, 1.0f, 1.0f);
@@ -1279,7 +1291,7 @@ float4 main_ps(ps_input input) : SV_TARGET
```diff
--- shader_1.hlsl 2023-08-16 08:32:39.100716400 +0200
-+++ shader_2.hlsl 2023-08-19 07:43:25.508151800 +0200
++++ shader_2.hlsl 2023-08-19 07:50:34.853809600 +0200
@@ -1,6 +1,12 @@
+cbuffer cv_viewport : register(b0)
+{
@@ -1294,16 +1306,15 @@ float4 main_ps(ps_input input) : SV_TARGET
};
struct ps_input
-@@ -8,25 +14,18 @@
- float4 position : SV_POSITION;
- };
-
--/*
-- * vertex shater program
-- *
+@@ -11,13 +17,18 @@
+ /*
+ * vertex shater program
+ *
- * @param input the 2 coordinates of a vertex, got from CPU
- * @return the 4D position of the pixel corresponding to the vertex in GPU
-- */
++ * @param input the 2 coordinates of a pixel, got from CPU
++ * @return the 4D position of the normalized coordinates of the vertex in GPU
+ */
ps_input main_vs(vs_input input )
{
ps_input output;
@@ -1316,16 +1327,7 @@ float4 main_ps(ps_input input) : SV_TARGET
+ output.position = float4(p, 0.0f, 1.0f);
return output;
}
-
--/*
-- * pixel shater program
-- *
-- * @param input the 4D coordinates of a pixel
-- * @return the color of the pixel in RGBA colorspace, here pink
-- */
- float4 main_ps(ps_input input) : SV_TARGET
- {
- return float4(1.0f, 0.0f, 1.0f, 1.0f);
+
```
**d3d_3.c**
@@ -1336,7 +1338,7 @@ float4 main_ps(ps_input input) : SV_TARGET
*
* Display pink triangle
* Add HLSL code and compile it at runtime (sufficient for now)
- * Computation of coordinates in GPU
+ * Computation of normalized coordinates in GPU
*
* Compilation:
*
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.