diff --git a/fa24/Homework/hw14/index.html b/fa24/Homework/hw14/index.html index 03d89d38..94dfbb1c 100644 --- a/fa24/Homework/hw14/index.html +++ b/fa24/Homework/hw14/index.html @@ -1074,6 +1074,7 @@
Virtual avatars and representations of people can be used as part of a digital twin. In Unreal Engine, MetaHumans are realistic-looking 3D human models generated with the MetaHuman Creator. Unreal is able to bring details in skin, fair, and facial expressions with Unreal. We can create MetaHumans to represent individuals for virtual meetings, trainings, simulations, and much more. In healthcare, we can also simulate patient behaviors for medical training or telehealth. In films and games, we can create realistic characters based on real-world individuals including ourselves!
For this homework assignment, please work with the character we have been working on during Unreal Mondays! Please make sure you are working with the project version with pathfinding (Unreal Engine AI with Navigation System - NavMesh).
Assignment Deadline
-Gradescope assignment due Friday, March 22nd 2024
+Gradescope assignment due Friday, December 6th 2024
Computer graphics allows us to create different things from a single pixel to a group of pixels. Pixel shading is one of many things that can be performed with computer graphics. Pixel shading refers to the process of computing a color for a pixel. On shader-based hardware, this is where your pixel shader is executed. In a basic forward renderer pass, where we are rendering objects into the frame buffer, the pixel is typically first lit and then fogged if fogging is being used. the output of a pixel shader consists of not only an RGB color, bu also an alpha value, which is usually interpreted as the "opacity" of the pixel, used for blending.
A shader is a shader program, a program that runs on a GPU. In Unity, shaders are categorized as such:
Shaders are an important part of the computer graphics rendering pipeline because they inform the computer how to render and shade objects within a scene. Shaders can powerfully enable speed and detail enhancements in a program and can provide special effects in 2D and 3D computer graphics.
HLSL is similar to the shader language, "Cg", which is a shader language developed by NVIDIA and GLSL, the shading langiage used in OpenGL. HLSL is the language that is behind Unity's shaders, a flexible and powerful shader that can be used within the context of Unity and other contexts. We can write many different kinds of shaders, they usually come in six forms including vertex shaders, geometry shaders, pixel shaders, compute shaders, ray tacing shaders, and tessellation shaders. Microsoft also uses this language for their Direct3D API to create GPU programs.
+Here is an example of HLSL Shader code from Microsoft's Documentation. This example uses a structure to provide multiple vertex shader inputs.
+vector vClr;
+
+struct VS_INPUT
+{
+ float4 vPosition : POSITION;
+ float3 vNormal : NORMAL;
+ float4 vBlendWeights : BLENDWEIGHT;
+};
+
+struct VS_OUTPUT
+{
+ float4 vPosition : POSITION;
+ float4 vDiffuse : COLOR;
+
+};
+
+float4x4 mWld1;
+float4x4 mWld2;
+float4x4 mWld3;
+float4x4 mWld4;
+
+float Len;
+float4 vLight;
+
+float4x4 mTot;
+
+VS_OUTPUT VS_Skinning_Example(const VS_INPUT v, uniform float len=100)
+{
+ VS_OUTPUT out;
+
+ // Skin position (to world space)
+ float3 vPosition =
+ mul(v.vPosition, (float4x3) mWld1) * v.vBlendWeights.x +
+ mul(v.vPosition, (float4x3) mWld2) * v.vBlendWeights.y +
+ mul(v.vPosition, (float4x3) mWld3) * v.vBlendWeights.z +
+ mul(v.vPosition, (float4x3) mWld4) * v.vBlendWeights.w;
+ // Skin normal (to world space)
+ float3 vNormal =
+ mul(v.vNormal, (float3x3) mWld1) * v.vBlendWeights.x +
+ mul(v.vNormal, (float3x3) mWld2) * v.vBlendWeights.y +
+ mul(v.vNormal, (float3x3) mWld3) * v.vBlendWeights.z +
+ mul(v.vNormal, (float3x3) mWld4) * v.vBlendWeights.w;
+
+ // Output stuff
+ out.vPosition = mul(float4(vPosition + vNormal * Len, 1), mTot);
+ out.vDiffuse = dot(vLight,vNormal);
+
+ return out;
+}
+
Important notes about HLSL syntax:
In Unity, Shader Graph is a tool that helps build shaders in a visual way. Instead of writing code, we are able to use a node-based system to create a graph framework. It is great in giving instant feedback that reflects our changes.
Unity's Visual Effect Graph (VFX Graph) allows you to create simple and complex visual effects from a node-based programming language that combines blocks, nodes, and sequences. These effects can range from common particle behaviors to complex scene simulations. Together, these nodes can be combined as building blocks to created advanced procedural effects.
According to the Unity Manual, the Visual Effect Graph is useful for:
Please follow the guides linked and reach at least Part 6.
+GitHub Pull Requests
-To receive credit for this homework assignment, please make sure you provide a link to your GitHub branch and name the branch as your first name.
-Then assign Nile and Debbie as Reviewers
and Assignees
before you hit the green Create Pull Request
button.
BrightSpace Submission
+Please take a video of the shaders you have created.