{"id":20261301,"url":"https://github.com/actnwit/shaderity-loader","last_synced_at":"2026-05-23T16:31:42.982Z","repository":{"id":47640957,"uuid":"210423514","full_name":"actnwit/shaderity-loader","owner":"actnwit","description":"A shaderity loader for WebPack","archived":false,"fork":false,"pushed_at":"2024-12-24T04:25:26.000Z","size":869,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":7,"default_branch":"develop","last_synced_at":"2025-01-14T04:25:26.471Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/actnwit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-23T18:21:10.000Z","updated_at":"2024-12-24T04:25:24.000Z","dependencies_parsed_at":"2024-11-14T11:29:22.445Z","dependency_job_id":"a65304c4-706e-4cd9-a6a2-8a54e1b6a329","html_url":"https://github.com/actnwit/shaderity-loader","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actnwit%2Fshaderity-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actnwit%2Fshaderity-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actnwit%2Fshaderity-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actnwit%2Fshaderity-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/actnwit","download_url":"https://codeload.github.com/actnwit/shaderity-loader/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241722573,"owners_count":20009382,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T11:25:11.058Z","updated_at":"2026-05-23T16:31:37.964Z","avatar_url":"https://github.com/actnwit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shaderity-loader\r\n\r\nshaderity-loader is a static GLSL shader loader for Webpack.\r\n\r\n## Features\r\n\r\n### Static features\r\n\r\nWith this `shaderity-loader`, you can do the following things:\r\n\r\n- Provide `#include` like statement for GLSL shader files. (similar syntax to glslify)\r\n- Embed GLSL shader files into TypeScript/JavaScript as a WebPack Loader.\r\n- Can be used in conjunction with glslify.\r\n\r\n### Runtime features\r\n\r\nWith [shaderity](https://github.com/actnwit/shaderity), you can do the following things:\r\n\r\n- Variables fill-in to GLSL code in runtime.\r\n- Transpile between GLSL ES 1.0 and GLSL ES 3.0 .\r\n\r\n## How to use\r\n\r\nWrite webpack.config.js like this.\r\n\r\n```javascript\r\n// webpack.config.js\r\nconst path = require('path');\r\n\r\nmodule.exports = {\r\n  entry: './test/fixture_loaders/index.js',\r\n  mode: 'development',\r\n  module: {\r\n    rules: [\r\n      {\r\n        test: /\\.(glsl|vs|fs|vert|frag)$/i,\r\n        exclude: /node_modules/,\r\n        use: [{\r\n          loader: path.resolve('index.js')\r\n        }]\r\n      }\r\n    ]\r\n  },\r\n  resolve: {\r\n    extensions: [\r\n      '.ts'\r\n    ]\r\n  },\r\n  output: {\r\n    path: path.resolve(__dirname, './fixture_loader_dist'),\r\n    filename: 'index.js',\r\n  },\r\n  optimization: {\r\n    namedChunks: true\r\n  }\r\n};\r\n\r\n```\r\n\r\nThese are shader codes for importing to TypeScript/JavaScript code.\r\n\r\n```glsl\r\n// output.frag\r\n\r\n#ifdef GLSL_ES_1\r\ngl_FragColor = rt0;\r\n#endif\r\n```\r\n\r\n```glsl\r\n// output_test.frag\r\nprecision mediump float;\r\n\r\nin vec4 vColor;\r\nin vec4 vTexcoord;\r\n\r\nvoid main() {\r\n  rt0 = vColor;\r\n  #pragma shaderity: require(./output.frag)\r\n}\r\n```\r\n\r\nYou can import them like this.\r\n\r\n```javascript\r\nimport shaderObj from '../fixtures/output_test.frag';\r\n\r\nconsole.out(convertedObj.shaderStage);\r\n// 'fragment'\r\n\r\nconsole.out(convertedObj.isFragmentShader);\r\n// 'true'\r\n\r\nconsole.out(convertedObj.code);\r\n/*\r\nprecision mediump float;\r\n\r\nin vec4 vColor;\r\nin vec4 vTexcoord;\r\n\r\nvoid main() {\r\n  rt0 = vColor;\r\n\r\n#ifdef GLSL_ES_1\r\ngl_FragColor = rt0;\r\n#endif\r\n*/\r\n```\r\n\r\nBuild this JavaScript code using Webpack.\r\n\r\n```\r\n$ webpack\r\n```\r\n\r\n## For developers\r\nWhen developing this library, please make sure to merge it into the develop branch. In order to be able to work closely with shaderity-node, the develop branch is also a submodule of shaderity-node and is included in the dependencies.\r\n\r\nThe only difference between the master branch and the develop branch is whether 'shaderity-node' is included as a submodule or not.\r\n\r\nWhen you publish this library, merge the code from the develop branch into the master branch. Make sure that the master branch does not have shaderity-node as a submodule, and that the version of the shaderity-node package in package.json is the version you intend.\r\n\r\n## LICENSE\r\n\r\nMIT License\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factnwit%2Fshaderity-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factnwit%2Fshaderity-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factnwit%2Fshaderity-loader/lists"}