-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shaders load but don't work #12655
Comments
Ah, shaders don't work with the atlas engine quite yet. This is tracked as a bullet point in #9999 but I'll leave this open to track it fully. Thanks! |
@zadjii-msft I will try without Atlas engine. |
@UltraStudioLTD Did you set your |
@lhecker It didn't work. I updated setting.json file posted to match currently used. |
@UltraStudioLTD You have |
@lhecker It didn't work. |
By the way here is C:\TMP\test.hlsl file // A minimal pixel shader that shows some raster bars
// The terminal graphics as a texture
Texture2D shaderTexture;
SamplerState samplerState;
// Terminal settings such as the resolution of the texture
cbuffer PixelShaderSettings {
// The number of seconds since the pixel shader was enabled
float Time;
// UI Scale
float Scale;
// Resolution of the shaderTexture
float2 Resolution;
// Background color as rgba
float4 Background;
};
// A pixel shader is a program that given a texture coordinate (tex) produces a color.
// tex is an x,y tuple that ranges from 0,0 (top left) to 1,1 (bottom right).
// Just ignore the pos parameter.
float4 main(float4 pos : SV_POSITION, float2 tex : TEXCOORD) : SV_TARGET
{
// Read the color value at the current texture coordinate (tex)
// float4 is tuple of 4 floats, rgba
float4 color = shaderTexture.Sample(samplerState, tex);
// Read the color value at some offset, will be used as shadow
float4 ocolor = shaderTexture.Sample(samplerState, tex+2.0*Scale*float2(-1.0, -1.0)/Resolution.y);
// Thickness of raster
const float thickness = 0.1;
float ny = floor(tex.y/thickness);
float my = tex.y%thickness;
const float pi = 3.141592654;
// ny is used to compute the rasterbar base color
float cola = ny*2.0*pi;
float3 col = 0.75+0.25*float3(sin(cola*0.111), sin(cola*0.222), sin(cola*0.333));
// my is used to compute the rasterbar brightness
// smoothstep is a great little function: https://en.wikipedia.org/wiki/Smoothstep
float brightness = 1.0-smoothstep(0.0, thickness*0.5, abs(my - 0.5*thickness));
float3 rasterColor = col*brightness;
// lerp(x, y, a) is another very useful function: https://en.wikipedia.org/wiki/Linear_interpolation
float3 final = rasterColor;
// Create the drop shadow of the terminal graphics
// .w is the alpha channel, 0 is fully transparent and 1 is fully opaque
final = lerp(final, float(0.0), ocolor.w);
// Draw the terminal graphics
final = lerp(final, color.xyz, color.w);
// Return the final color, set alpha to 1 (ie opaque)
return float4(final, 1.0);
} |
I even reopened it |
What's your settings,json? |
Oh and I am using Preview version by the way |
I'm using your settings.json and the same Windows Terminal version (1.13.10336.0). |
I solved issue by switching to Software Rendering instead of Hardware Rendering |
This is interesting actually. Can you tell us more about the hardware you use? What's your CPU and GPU? Do you use Windows Terminal via a Virtual Machine, Remote Desktop, or some other mechanism? If you have the time and would like to investigate (really just in case), could you enable hardware rendering again and download DebugView and see if any logs come up when you start Windows Terminal ("WT")? If you go into your start menu and search for If you're done debugging, don't forget to "Clear" the "Executable List". You need to click "Apply" (or "OK") in the primary window in order for the change to take effect. All of that is just in case you have the time and interest in investigating this of course. 🙂 |
@lhecker I will upload details later when I will have time. For now I will enjoy CRT shader that I always wanted (since cool-retro-term) |
@lhecker
|
And as I mentioned HLSL rendering works only with Software Rendering with both Preview and Stable versions |
Found it:
Your GPU only supports feature level 10.0 for DirectX, which only apparently supports HLSL 4.0. |
@UltraStudioLTD I've fixed the issue and will submit a pull request soon. Thank you for your great help! The log file you sent me immediately helped me find and fix the issue. 🙂 Unfortunately we're likely "soon" (next year?) dropping support for hardware-acceleration for hardware below feature level |
@lhecker Well, by looks it would be better to upgrade/replace my entire PC since every card and board, including motherboard is very old and not compatible with new cards 😭. Well, thanks for fixing issue 👍 |
* Drop engine support for DirectX 9.1 Practically no one has such old hardware anymore and AtlasEngine additionally drops support for 10.0. The fallback also didn't work properly, because the `FeatureLevels` array failed to include 9.2 and 9.3. We'll simply fall back to WARP on all such devices. * Optimize shaders during compilation The two new flags increase shader performance sometimes significantly. * Fix shader feature level flags D3D feature level 10.0 only support 4.0 and 10.1 only 4.1 shaders. ## PR Checklist * [x] Closes #12655 * [x] I work here * [x] Tests added/passed ## Validation Steps Performed * Add `WindowsTerminal.exe` in `dxcpl.exe` * Add a basic `experimental.pixelShaderPath` * All forced feature levels between `9_1` and `11_1` render as expected ✅
* Drop engine support for DirectX 9.1 Practically no one has such old hardware anymore and AtlasEngine additionally drops support for 10.0. The fallback also didn't work properly, because the `FeatureLevels` array failed to include 9.2 and 9.3. We'll simply fall back to WARP on all such devices. * Optimize shaders during compilation The two new flags increase shader performance sometimes significantly. * Fix shader feature level flags D3D feature level 10.0 only support 4.0 and 10.1 only 4.1 shaders. ## PR Checklist * [x] Closes #12655 * [x] I work here * [x] Tests added/passed ## Validation Steps Performed * Add `WindowsTerminal.exe` in `dxcpl.exe` * Add a basic `experimental.pixelShaderPath` * All forced feature levels between `9_1` and `11_1` render as expected ✅ (cherry picked from commit d5fb736)
* Drop engine support for DirectX 9.1 Practically no one has such old hardware anymore and AtlasEngine additionally drops support for 10.0. The fallback also didn't work properly, because the `FeatureLevels` array failed to include 9.2 and 9.3. We'll simply fall back to WARP on all such devices. * Optimize shaders during compilation The two new flags increase shader performance sometimes significantly. * Fix shader feature level flags D3D feature level 10.0 only support 4.0 and 10.1 only 4.1 shaders. ## PR Checklist * [x] Closes #12655 * [x] I work here * [x] Tests added/passed ## Validation Steps Performed * Add `WindowsTerminal.exe` in `dxcpl.exe` * Add a basic `experimental.pixelShaderPath` * All forced feature levels between `9_1` and `11_1` render as expected ✅ (cherry picked from commit d5fb736)
🎉This issue was addressed in #12677, which has now been successfully released as Handy links: |
🎉This issue was addressed in #12677, which has now been successfully released as Handy links: |
Windows Terminal version
1.13.10336.0 Preview
Windows build number
10.0.19042.1586
Other Software
No response
Steps to reproduce
I have downloaded https://github.com/microsoft/terminal/blob/main/samples/PixelShaders/Rasterbars.hlsl as test.hlsl file and placed it in *C:\TMP* directory. Then I changed my Windows Terminal configuration like below:
Expected Behavior
Actual Behavior
The text was updated successfully, but these errors were encountered: