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 @@

Digital Twins

Digital Humans

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!

Problems

+

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).

Problem 1: Design Character

Step 1: Documentation diff --git a/fa24/Homework/hw13/VFX Graph Shader Graph.jpg b/fa24/Homework/hw15/VFX Graph Shader Graph.jpg similarity index 100% rename from fa24/Homework/hw13/VFX Graph Shader Graph.jpg rename to fa24/Homework/hw15/VFX Graph Shader Graph.jpg diff --git a/fa24/Homework/hw15/glslViewer.gif b/fa24/Homework/hw15/glslViewer.gif new file mode 100644 index 00000000..f9f8835d Binary files /dev/null and b/fa24/Homework/hw15/glslViewer.gif differ diff --git a/fa24/Homework/hw15/headerImage.png b/fa24/Homework/hw15/headerImage.png new file mode 100644 index 00000000..a88b9dee Binary files /dev/null and b/fa24/Homework/hw15/headerImage.png differ diff --git a/fa24/Homework/hw15/hlsl.png b/fa24/Homework/hw15/hlsl.png new file mode 100644 index 00000000..6b452d36 Binary files /dev/null and b/fa24/Homework/hw15/hlsl.png differ diff --git a/fa24/Homework/hw15/index.html b/fa24/Homework/hw15/index.html index 3fc7b30d..65740678 100644 --- a/fa24/Homework/hw15/index.html +++ b/fa24/Homework/hw15/index.html @@ -818,6 +818,15 @@ + + +
  • + + + Problems + + +
  • @@ -1034,13 +1043,13 @@

    ❄️ HW 15: Shaders and VFX

    Assignment Deadline

    -

    Gradescope assignment due Friday, March 22nd 2024

    +

    Gradescope assignment due Friday, December 6th 2024

    Submit

    -

    Image title

    +

    Image title

    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.

    Shaders

    -

    Image title

    +

    Image title

    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

    -

    Image title

    +

    Image title

    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:

    Shader Graph

    -

    Image title

    +

    Image title

    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.

    Visual Effect Graph

    -

    Image title

    +

    Image title

    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:

    +

    Problems

    +
    +ShaderGraph with Unity +

    Please follow the guides linked and reach at least Part 6.

    + +

    Image title

    +

    Submission

    -

    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.

    -

    Image title

    -

    Image title

    -

    Image title

    +

    BrightSpace Submission

    +

    Please take a video of the shaders you have created.

    diff --git a/fa24/Homework/hw15/shaderGraphHomework.png b/fa24/Homework/hw15/shaderGraphHomework.png new file mode 100644 index 00000000..0866ce18 Binary files /dev/null and b/fa24/Homework/hw15/shaderGraphHomework.png differ diff --git a/fa24/Homework/hw13/vfx1.jpeg b/fa24/Homework/hw15/vfx1.jpeg similarity index 100% rename from fa24/Homework/hw13/vfx1.jpeg rename to fa24/Homework/hw15/vfx1.jpeg