{"id":16125036,"url":"https://github.com/hughsk/webgl-texture3d","last_synced_at":"2025-04-14T22:52:04.603Z","repository":{"id":65997209,"uuid":"8231596","full_name":"hughsk/webgl-texture3d","owner":"hughsk","description":"Workaround GLSL function for using 3D textures in WebGL","archived":false,"fork":false,"pushed_at":"2013-02-16T05:21:46.000Z","size":98,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T10:54:12.408Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hughsk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-16T04:54:51.000Z","updated_at":"2023-03-15T02:45:25.000Z","dependencies_parsed_at":"2023-02-19T21:00:46.293Z","dependency_job_id":null,"html_url":"https://github.com/hughsk/webgl-texture3d","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughsk%2Fwebgl-texture3d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughsk%2Fwebgl-texture3d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughsk%2Fwebgl-texture3d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughsk%2Fwebgl-texture3d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hughsk","download_url":"https://codeload.github.com/hughsk/webgl-texture3d/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975308,"owners_count":21192199,"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-10-09T21:25:21.999Z","updated_at":"2025-04-14T22:52:04.584Z","avatar_url":"https://github.com/hughsk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webgl-texture3d\n\nWorkaround for the lack of `sampler3D` (3D textures) in WebGL -\nsourced from [this example](https://code.google.com/p/webglsamples/source/browse/color-adjust/color-adjust.html),\nand modified for use with [browserify](http://browserify.org/).\n\n## Installation ##\n\n``` bash\nnpm install webgl-texture3d\n```\n\n## Usage ##\n\n**texture3d(name, resolution)**\n\nReturns a GLSL method string, with the size cached at `resolution` pixels wide/high/deep.\n\n**texture3d.dynamic**\n\nPlain `sampleAs3DTexture` method string.\n\n``` javascript\nvar texture3d = require('webgl-texture3d')\n  , sampleAs3DTexture = texture3d('sampleAs3DTexture', 33)\n\nvar vertexShader = [\n  'uniform sampler2D colorTable;'\n, 'uniform sampler2D source;'\n, 'uniform vec2 pixel;'\n\n, sampleAs3DTexture\n\n, 'void main() {'\n  , 'vec4 texel = texture2D(source, pixel);'\n  , 'gl_FragColor = sampleAs3DTexture(colorTable, texel.rgb);'\n, '}'\n].join('\\n')\n```\n\n## License ##\n\nCopyright 2011, Google Inc.\nAll rights reserved.\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n    * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n    * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhughsk%2Fwebgl-texture3d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhughsk%2Fwebgl-texture3d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhughsk%2Fwebgl-texture3d/lists"}