[PR #9026] [MERGED] Add animated shader samples #27380

Open
opened 2026-01-31 09:21:39 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/9026
Author: @Nacimota
Created: 2/3/2021
Status: Merged
Merged: 2/4/2021
Merged by: @zadjii-msft

Base: mainHead: new-shader-samples


📝 Commits (4)

  • c30d541 Clarify comments in example shaders
  • 1ce212a Add animated (breathe and scan) sample shaders
  • 2a95380 Add animation section to the shader samples readme
  • 83117b3 Merge branch 'main' into new-shader-samples

📊 Changes

7 files changed (+177 additions, -15 deletions)

View changed files

samples/PixelShaders/Animate_breathe.hlsl (+42 -0)
samples/PixelShaders/Animate_scan.hlsl (+45 -0)
📝 samples/PixelShaders/Grayscale.hlsl (+4 -3)
📝 samples/PixelShaders/Invert.hlsl (+4 -3)
📝 samples/PixelShaders/README.md (+78 -6)
📝 samples/PixelShaders/Rasterbars.hlsl (+4 -3)
samples/PixelShaders/Screenshots/GraphCosine.png (+0 -0)

📄 Description

Summary of the Pull Request

  • Adds two simple animated shaders to the pixel shaders sample folder
  • Updates the readme in the pixel shaders sample folder to add a section explaining the animated shaders
  • Modifies some comments in existing shader samples

PR Checklist

  • CLA signed. If not, go over here and sign the CLA
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #8994

Detailed Description of the Pull Request / Additional comments

The two shaders I wrote are not especially pretty or interesting, but they should hopefully serve as simple examples for anyone looking to do animated effects. One simply draws a line of inverted pixels that scrolls down the screen, and the other fades the background back and forth between two colors.

I've added a new section to the readme explaining how the shaders work to achieve animated effects.

I've also updated the comments on the existing shaders to clear up a couple of things:

  1. Be more explicit that Time represents seconds since the shader loaded. Though obvious in hindsight, this was not clear to me when I was first learning/experimenting
  2. Explain that tex ranges from 0,0 to 1,1. This is important because, when trying to port GLSL shaders from shadertoy, I at first assumed fragCoord and tex are the same thing but the former actually ranges from 0,0 to the resolution of the canvas, so some of the math doesn't work out if you just substitute it with tex.

Any and all feedback welcome.

Validation Steps Performed

I ran the shaders manually in a dev build of the Terminal. I auto-spellchecked and manually proofread my additions to the readme and verifed the markdown rendering on github.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/9026 **Author:** [@Nacimota](https://github.com/Nacimota) **Created:** 2/3/2021 **Status:** ✅ Merged **Merged:** 2/4/2021 **Merged by:** [@zadjii-msft](https://github.com/zadjii-msft) **Base:** `main` ← **Head:** `new-shader-samples` --- ### 📝 Commits (4) - [`c30d541`](https://github.com/microsoft/terminal/commit/c30d5417ac1292934e8b265998a254a89932c946) Clarify comments in example shaders - [`1ce212a`](https://github.com/microsoft/terminal/commit/1ce212a6b3440d216d726ad821d3c639896b9832) Add animated (breathe and scan) sample shaders - [`2a95380`](https://github.com/microsoft/terminal/commit/2a953806c69389e0f61dbea254a6b3cee3afb48b) Add animation section to the shader samples readme - [`83117b3`](https://github.com/microsoft/terminal/commit/83117b3af00a6230e625c12a215e447e7f9a08ac) Merge branch 'main' into new-shader-samples ### 📊 Changes **7 files changed** (+177 additions, -15 deletions) <details> <summary>View changed files</summary> ➕ `samples/PixelShaders/Animate_breathe.hlsl` (+42 -0) ➕ `samples/PixelShaders/Animate_scan.hlsl` (+45 -0) 📝 `samples/PixelShaders/Grayscale.hlsl` (+4 -3) 📝 `samples/PixelShaders/Invert.hlsl` (+4 -3) 📝 `samples/PixelShaders/README.md` (+78 -6) 📝 `samples/PixelShaders/Rasterbars.hlsl` (+4 -3) ➕ `samples/PixelShaders/Screenshots/GraphCosine.png` (+0 -0) </details> ### 📄 Description ## Summary of the Pull Request - Adds two simple animated shaders to the pixel shaders sample folder - Updates the readme in the pixel shaders sample folder to add a section explaining the animated shaders - Modifies some comments in existing shader samples ## PR Checklist * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #8994 ## Detailed Description of the Pull Request / Additional comments The two shaders I wrote are not especially pretty or interesting, but they should hopefully serve as simple examples for anyone looking to do animated effects. One simply draws a line of inverted pixels that scrolls down the screen, and the other fades the background back and forth between two colors. I've added a new section to the readme explaining how the shaders work to achieve animated effects. I've also updated the comments on the existing shaders to clear up a couple of things: 1. Be more explicit that `Time` represents seconds since the shader loaded. Though obvious in hindsight, this was not clear to me when I was first learning/experimenting 2. Explain that `tex` ranges from 0,0 to 1,1. This is important because, when trying to port GLSL shaders from shadertoy, I at first assumed `fragCoord` and `tex` are the same thing but the former actually ranges from 0,0 to the resolution of the canvas, so some of the math doesn't work out if you just substitute it with `tex`. Any and all feedback welcome. ## Validation Steps Performed I ran the shaders manually in a dev build of the Terminal. I auto-spellchecked and manually proofread my additions to the readme and verifed the markdown rendering on github. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:21:39 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27380