stanoddly / DotnetRaylibWasm

Prototype for .NET 7 with Raylib compiled into WebAssembly (wasm)
MIT License
61 stars 8 forks source link

Resources in subdirectories don't work #10

Closed stanoddly closed 1 year ago

stanoddly commented 1 year ago

I guess something about this line isn't right: https://github.com/disketteman/DotnetRaylibWasm/blob/36c1199/DotnetRaylibWasm/DotnetRaylibWasm.csproj#L39

It's failing for example in: https://disketteman.github.io/DotnetRaylibWasm/raylib.html?arg=LoadingDemo

WARNING: FILEIO: [resources/models/obj/castle.obj] Failed to open text file
dotnet.js:14 WARNING: MESH: [resources/models/obj/castle.obj] Failed to load mesh data, default to cube mesh
dotnet.js:14 INFO: VAO: [ID 12] Mesh uploaded successfully to VRAM (GPU)
dotnet.js:14 WARNING: MATERIAL: [resources/models/obj/castle.obj] Failed to load material data, default to white material
dotnet.js:14 WARNING: FILEIO: [resources/models/obj/castle_diffuse.png] Failed to open file
stanoddly commented 1 year ago

I checked the filesystem with very primitive way:

        Console.WriteLine("FILENAMES");
        foreach (string filename in Directory.GetFiles("resources", "*.*", SearchOption.AllDirectories))
        {
            Console.WriteLine($"FILENAME: {filename}");
        }

And guess what - the subdirectories work, but resources/models/obj/castle.obj isn't there:

FILENAMES
dotnet.js:2122 FILENAME: resources/billboard.png
dotnet.js:2122 FILENAME: resources/cubicmap.png
dotnet.js:2122 FILENAME: resources/cat.png
dotnet.js:2122 FILENAME: resources/button.png
dotnet.js:2122 FILENAME: resources/cubicmap_atlas.png
dotnet.js:2122 FILENAME: resources/cyberpunk_street_background.png
dotnet.js:2122 FILENAME: resources/cyberpunk_street_midground.png
dotnet.js:2122 FILENAME: resources/dresden_square_1k.hdr
dotnet.js:2122 FILENAME: resources/egg.png
dotnet.js:2122 FILENAME: resources/cyberpunk_street_foreground.png
dotnet.js:2122 FILENAME: resources/explosion.png
dotnet.js:2122 FILENAME: resources/dresden_square_2k.hdr
dotnet.js:2122 FILENAME: resources/heightmap.png
dotnet.js:2122 FILENAME: resources/mask.png
dotnet.js:2122 FILENAME: resources/fudesumi.png
dotnet.js:2122 FILENAME: resources/fudesumi.raw
dotnet.js:2122 FILENAME: resources/ninepatch_button.png
dotnet.js:2122 FILENAME: resources/patterns.png
dotnet.js:2122 FILENAME: resources/parrots.png
dotnet.js:2122 FILENAME: resources/raylib-cs_logo.png
dotnet.js:2122 FILENAME: resources/ps3.png
dotnet.js:2122 FILENAME: resources/raysan.png
dotnet.js:2122 FILENAME: resources/plasma.png
dotnet.js:2122 FILENAME: resources/scarfy.png
dotnet.js:2122 FILENAME: resources/skybox.png
dotnet.js:2122 FILENAME: resources/spark_flame.png
dotnet.js:2122 FILENAME: resources/space.png
dotnet.js:2122 FILENAME: resources/wabbit_alpha.png
dotnet.js:2122 FILENAME: resources/torus.png
dotnet.js:2122 FILENAME: resources/symbola.png
dotnet.js:2122 FILENAME: resources/texel_checker.png
dotnet.js:2122 FILENAME: resources/xbox.png
dotnet.js:2122 FILENAME: resources/audio/boom.wav
dotnet.js:2122 FILENAME: resources/audio/buttonfx.wav
dotnet.js:2122 FILENAME: resources/audio/coin.wav
dotnet.js:2122 FILENAME: resources/audio/country.mp3
dotnet.js:2122 FILENAME: resources/audio/mini1111.xm
dotnet.js:2122 FILENAME: resources/audio/sound.wav
dotnet.js:2122 FILENAME: resources/audio/spring.wav
dotnet.js:2122 FILENAME: resources/audio/weird.wav
dotnet.js:2122 FILENAME: resources/audio/target.ogg
dotnet.js:2122 FILENAME: resources/audio/target.flac
dotnet.js:2122 FILENAME: resources/fonts/alpha_beta.png
dotnet.js:2122 FILENAME: resources/fonts/alagard.png
dotnet.js:2122 FILENAME: resources/fonts/custom_jupiter_crash.png
dotnet.js:2122 FILENAME: resources/fonts/custom_alagard.png
dotnet.js:2122 FILENAME: resources/fonts/anonymous_pro_bold.ttf
dotnet.js:2122 FILENAME: resources/fonts/dejavu.fnt
dotnet.js:2122 FILENAME: resources/fonts/custom_mecha.png
dotnet.js:2122 FILENAME: resources/fonts/jupiter_crash.png
dotnet.js:2122 FILENAME: resources/fonts/dejavu.png
dotnet.js:2122 FILENAME: resources/fonts/KAISG.ttf
dotnet.js:2122 FILENAME: resources/fonts/noto_cjk.fnt
dotnet.js:2122 FILENAME: resources/fonts/mecha.png
dotnet.js:2122 FILENAME: resources/fonts/noto_cjk.png
dotnet.js:2122 FILENAME: resources/fonts/pixantiqua.png
dotnet.js:2122 FILENAME: resources/fonts/setback.png
dotnet.js:2122 FILENAME: resources/fonts/pixantiqua.fnt
dotnet.js:2122 FILENAME: resources/fonts/romulus.png
dotnet.js:2122 FILENAME: resources/fonts/pixantiqua.ttf
dotnet.js:2122 FILENAME: resources/fonts/pixelplay.png
dotnet.js:2122 FILENAME: resources/fonts/symbola.fnt
dotnet.js:2122 FILENAME: resources/models/barracks_diffuse.png
dotnet.js:2122 FILENAME: resources/models/barracks.obj
dotnet.js:2122 FILENAME: resources/models/church.obj
dotnet.js:2122 FILENAME: resources/models/church_diffuse.png
dotnet.js:2122 FILENAME: resources/models/watermill_diffuse.png
dotnet.js:2122 FILENAME: resources/models/watermill.obj
dotnet.js:2122 FILENAME: resources/models/gltf/AnimatedMorphCube.glb
dotnet.js:2122 FILENAME: resources/models/gltf/AnimatedTriangle.gltf
dotnet.js:2122 FILENAME: resources/models/gltf/LICENSE
dotnet.js:2122 FILENAME: resources/models/gltf/BoxAnimated.glb
dotnet.js:2122 FILENAME: resources/models/gltf/raylib_32x32.glb
dotnet.js:2122 FILENAME: resources/models/gltf/girl.glb
dotnet.js:2122 FILENAME: resources/models/gltf/vertex_colored_object.glb
dotnet.js:2122 FILENAME: resources/models/gltf/rigged_figure.glb
dotnet.js:2122 FILENAME: resources/models/iqm/guyanim.iqm
dotnet.js:2122 FILENAME: resources/models/iqm/guy.blend
dotnet.js:2122 FILENAME: resources/models/iqm/guy.iqm
dotnet.js:2122 FILENAME: resources/models/iqm/vertex_colored_object.iqm
dotnet.js:2122 FILENAME: resources/models/iqm/guytex.png
dotnet.js:2122 FILENAME: resources/models/vox/chr_knight.vox
dotnet.js:2122 FILENAME: resources/models/vox/chr_sword.vox
dotnet.js:2122 FILENAME: resources/models/vox/LICENSE
dotnet.js:2122 FILENAME: resources/models/vox/monu9.vox
dotnet.js:2122 FILENAME: resources/shaders/glsl100/alpha_discard.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/base.vs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/base_lighting_instanced.vs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/bloom.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/base.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/base_lighting.vs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/color_mix.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/cross_hatching.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/cubemap.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/cross_stitching.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/blur.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/cubes_panning.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/cubemap.vs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/distortion.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/distortion100.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/fog.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/depth.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/fisheye.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/eratosthenes.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/julia_set.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/grayscale.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/dream_vision.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/mask.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/outline.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/lighting.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/posterization.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/point_particle.vs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/palette_switch.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/predator.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/point_particle.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/reload.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/pixelizer.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/scanlines.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/skybox.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/sobel.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/sdf.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/raymarching.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/skybox.vs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/swirl.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/wave.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl100/spotlight.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/base.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/base.vs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/base_lighting.vs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/blur.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/cross_stitching.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/cross_hatching.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/bloom.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/distortion.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/fisheye.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/grayscale.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/palette_switch.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/dream_vision.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/fog.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/posterization.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/scanlines.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/pixelizer.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/sobel.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/predator.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl120/swirl.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/alpha_discard.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/base.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/base.vs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/base_lighting_instanced.vs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/bloom.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/blur.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/base_lighting.vs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/cross_hatching.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/cross_stitching.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/cubemap.vs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/depth.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/distortion.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/color_mix.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/dream_vision.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/cubes_panning.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/cubemap.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/eratosthenes.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/fog.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/grayscale.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/fisheye.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/julia_set.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/lighting.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/mask.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/outline.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/overdraw.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/palette_switch.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/pixelizer.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/point_particle.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/predator.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/posterization.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/point_particle.vs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/sdf.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/skybox.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/skybox.vs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/reload.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/raymarching.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/scanlines.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/wave.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/sobel.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/swirl.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl330/spotlight.fs
dotnet.js:2122 FILENAME: resources/shaders/glsl430/gol.glsl
dotnet.js:2122 FILENAME: resources/shaders/glsl430/gol_transfert.glsl
dotnet.js:2122 FILENAME: resources/shaders/glsl430/gol_render.glsl

In fact, it's not even in the repository. And it turned out that the original example were missing files and thus are broken in the first place.

My reaction can be very well described by this gif:

stanoddly commented 1 year ago

And the reason is... .gitignore! https://github.com/ChrisDill/Raylib-cs-Examples/blob/master/.gitignore#L39

The same issue is in this very repository: https://github.com/disketteman/DotnetRaylibWasm/blob/main/.gitignore#L30

I will forcefully add the files with:

git add -f Examples\resources\models\obj