Comments (7)
I fired up a Win10 VM and took a look. I think I resolved the file loading + crashing issue. Turns out, they were two unrelated problems.
Let me know if it works for you now.
Resolved by #101
from c-ray.
I tested it and works fine.
Thank you!
from c-ray.
Hi! Thanks for reporting this.
Interesting! Looks like a regression, likely my fault for not checking the newer file loading code thoroughly on Windows.
I don't have a Windows box on hand to start debugging right now, but it looks like the issue is likely in getFilePath()
, where it blindly appends a forward slash, assuming it'll be a UNIX filepath.
Specifically we get two forward slashes, since we reconstruct the full path to the mtl file in parseWavefront()
, and then again grab the asset path from that full string in parseMTLFile().
Could you try substituting that getFilePath() function with this one below, and see if it works? I can test it myself later this week as well if you're busy.
char *getFilePath(const char *input) {
char *dir = NULL;
#ifdef WINDOWS
dir = calloc(256, sizeof(*dir));
_splitpath_s(input, NULL, 0, dir, sizeof(dir), NULL, 0, NULL, 0);
return dir;
#else
char *inputCopy = stringCopy(input);
dir = stringCopy(dirname(inputCopy));
free(inputCopy);
char *final = stringConcat(dir, "/");
free(dir);
return final;
#endif
}
from c-ray.
Thank you for your reply. I tested with the given modification but still have the issue.
I also built and ran on Linux and got this:
': No such file or directory Can't access './input/tonni.mtl
': No such file or directory Can't access './input/newScene.mtl
': No such file or directory Can't access './input/torus.mtl
': No such file or directory Can't access './input/teapot.mtl
': No such file or directory Can't access './input/teapot_green.mtl
from c-ray.
@mandyedi Is that under Visual Studio? If so, c-ray assumes you're using relative paths from the current working directory. Try setting the CWD to the project root directory.
The earlier invocation you showed:
bin\Release\c-ray.exe input\scene.json
from the command prompt looks to be doing this correctly already, so that should work.
from c-ray.
+1 I have this same issue currently on Windows. It can't find the assets and crashes.
from c-ray.
Great to hear! Closing this as resolved, then.
from c-ray.
Related Issues (20)
- How to compile custom build with Cygwin for Windows? HOT 1
- New rendering protocol doesn't work on Windows
- Add an NSI C binding HOT 6
- Rendering protocol doesn't work across architectures HOT 1
- How to run on Apple Silicon MacBook Pro? HOT 7
- The rendered image is not sharp as that in c-ray readme HOT 4
- munmap error when rendering an obj file HOT 4
- Crash with OBJ files from OneShape HOT 7
- Failed to build on MSYS2 MINGW64 HOT 4
- How to change the camera position and direction
- Flatten k-d trees. HOT 2
- Implement a top-level BVH. HOT 6
- Do not force the compiler version HOT 2
- Make the material system physically correct HOT 1
- Implement more nodes
- Implement cubic interpolation HOT 2
- Implement next event estimation
- Implement multiple importance sampling
- Implement cluster rendering HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c-ray.