GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - sselecirPyM/ShaderNote: Write and debug Shader in an easy way.

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
ShaderNote.ModelLoaders
ShaderNote.ModelLoaders
 
 
ShaderNote
ShaderNote
 
 
ShaderNoteD3D12
ShaderNoteD3D12
 
 
ShaderNoteTest
ShaderNoteTest
 
 
ShaderNoteTestD3D12
ShaderNoteTestD3D12
 
 
examples
examples
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
ShaderNote.sln
ShaderNote.sln
 
 

Repository files navigation

ShaderNote

用于快速验证着色器效果的工具。

入门

using ShaderNote;
using System.Numerics;
NoteDevice noteDevice = new NoteDevice();

var render = noteDevice.GetRecord()
    .WithVertexShader("Shaders/VertexShader.hlsl")
    .WithPixelShader("Shaders/PixelShader.hlsl")
    .WithIndexBuffer(data: new ushort[] { 0, 2, 1, 1, 2, 3 })
    .WithVertexBuffer(0, 12, data: new Vector3[]
    {
        new(0,0,0),
        new(1,0,0),
        new(0,1,0),
        new(1,1,0),
    })
    .WithVertexBuffer(1, 8, data: new Vector2[]
    {
        new(0,0),
        new(1,0),
        new(0,1),
        new(1,1),
    })
    .WithSampler(0)
    .WithImage(0, "sample.png")
    .WithDrawIndexed(6);
render.Save("test.png");

在Polyglot Notebooks使用Shader Note

  1. 安装.Net 7 SDK

  2. 在Visual Studio Code中安装Polyglot Notebooks扩展

  3. 注册格式

using Microsoft.DotNet.Interactive.Formatting;
using ShaderNote;

Formatter.Register<RenderRecord>((w)=>
{
    var result = w.Render();
    string html = result.GetHtml();
    result.Dispose();
    return html;
},HtmlFormatter.MimeType);
  1. 将RenderRecord类型置于单元格最后,不要加分号。
var render = noteDevice.GetRecord()
    .WithVertexShader("Shaders/VertexShader.hlsl")
    .WithPixelShader("Shaders/PixelShader.hlsl")
    .WithIndexBuffer(data: new ushort[] { 0, 2, 1, 1, 2, 3 })
    .WithVertexBuffer(0, 12, data: new Vector3[]
    {
        new(0,0,0),
        new(1,0,0),
        new(0,1,0),
        new(1,1,0),
    })
    .WithVertexBuffer(1, 8, data: new Vector2[]
    {
        new(0,0),
        new(1,0),
        new(0,1),
        new(1,1),
    })
    .WithSampler(0)
    .WithImage(0, "sample.png")
    .WithDrawIndexed(6);
//用于显示
render

你可以在examples文件夹下找到示例。

About

Write and debug Shader in an easy way.

Resources

Readme
GPL-3.0 license
Activity

Stars

9 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.