Giter Site home page Giter Site logo

Need some way of loading a GLSL shader directly instead of converting from HLSL, or a binding in skshaderc for GLSL samplerExternalOES about stereokit HOT 4 CLOSED

nrewkowski avatar nrewkowski commented on May 29, 2024
Need some way of loading a GLSL shader directly instead of converting from HLSL, or a binding in skshaderc for GLSL samplerExternalOES

from stereokit.

Comments (4)

maluoi avatar maluoi commented on May 29, 2024

Linking this discussion here, as it's quite relevant: #874

I have been meaning to look into this! My preference I think is still primarily towards adding tags for OES textures.

from stereokit.

maluoi avatar maluoi commented on May 29, 2024

Making a note here for myself, looks like spirv_cross has a Compiler::set_variable_type_remap_callback function which is explicitly designed for cases like samplerExternalOES.

This probably fits in skshaderc somewhere around here (this is a branch with some other improvements I'd like to get in), but unfortunately set_variable_type_remap_callback is only available in spirv_cross's C++ API. skshaderc uses the C API, so the GLSL emitting function will either need to be re-written with the C++ API (most likely), or some backdoor will need to be used to get the Compiler object (might be beyond my C++ skills).

from stereokit.

maluoi avatar maluoi commented on May 29, 2024

An update on this one, I've got this working in a sk_gpu branch! Shader format is using a slightly new version though, so it'll need to be integrated into latest StereoKit before it'll be useful.

No big surprises, it'll basically just use an external tag, and looks like this:

//--tex_name : external = white
Texture2D    tex_name         : register(t0);
SamplerState tex_name_sampler : register(s0);

from stereokit.

nrewkowski avatar nrewkowski commented on May 29, 2024

Great, thanks! looking forward to the merge

from stereokit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.