compute-toys / wgpu-compute-toy

Cross-platform compute shader engine
https://compute.toys
MIT License
119 stars 16 forks source link

No images found when running some examples #12

Open sophia-long opened 1 year ago

sophia-long commented 1 year ago

I attempted to test some examples, and most of them ran perfectly. However, I found that some examples require texture images. These examples run successfully when the images are sourced from URLs. However, when attempting to use local images, the examples generate an 'image not found' error. For instance, the '/fabrice/utils.wgsl' example includes a JSON file:

{
    "uniforms": [],
    "textures": [
        {
            "img": "/textures/font0.png"
        },
        {
            "img": "/textures/london.jpg"
        }
    ],
    "float32Enabled": false
}

It appears that the 'font0.png' and 'london.jpg' files are not present in the project's directory structure. How can this issue be resolved?

Additionally, does the 'wgpu-compute-toy' project support cube maps, in addition to 2D textures?

davidar commented 1 year ago

It should be trying to fetch those from the website, eg https://compute.toys/textures/london.jpg

If you want a local copy of those files, they can be found in https://github.com/compute-toys/compute.toys/tree/master/public/textures

We don't currently have any support for cubemaps