-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
offline rendering #33
Comments
Hi @dafhi Yes since the demos all require http get requests - nothing will work unless you have a simple server running in the background, serving up the various files. Images such as textures that the demos need and files such as the shaders (external .glsl files) cannot be loaded from your hard drive directly as this is a violation of CORS policy, which prevents cross-origin resource sharing. If this safety feature was not in place, .html web pages could access private files on your hard drive if those .html files contained malicious JavaScript code. The easiest way to get my (and other web-based) projects going is to use Microsoft's free Visual Studio Code editor. After it's installed, get the Live web server extension (available inside the editor), then restart the Code editor. When the editor opens up, click Open File... then navigate to my gh-pages folder that you unzipped to your hard drive after the GitHub download. Open up a random .html demo file (CornellBox.html for example) from the menu on the left side of your editor, and then right click on the code and click Open with Live server. It will automatically open up your default browser and hopefully every demo should work. The great thing is that if you want to make changes to my fragment shaders (the heart of every demo), even if you make a one character change while the Live server is running, it will automatically re-compile the shader and you can instantly see your changes (assuming that the new code is syntactically correct). This fast iteration turnaround is one of the reasons I chose a web-based project instead of C++ and OpenGL for instance. The reason why my project works on GitHub is that if you offer up your project as an open source project, GitHub agrees to serve it up for free. So it's like getting free web hosting for your website (or my demos that are technically like little individual .html websites), as long as you keep the code visible to the public. I have no problem doing this as I was offering source code and finished games for free back in 1999 before open source was a 'thing'! :-D Let me know if you need any further help getting everything going. |
after selecting 'open w live server' msg box |
here's one more screenshot showing the file view. The editor needs to see the whole gh-pages folder at once, so you have to click Open Folder... (not File as you would normally do) and select the entire gh-pages folder that is unzipped on your hard drive. Once you see that all the files show up in the file explorer column, then left click ArcticCircle.html for instance (like in my 1st screenshot), then right click and select open with Live Server. On the bottom right corner, it should have the port number (5500 for instance) if the server started up successfully. |
googled "Live Server" and "application not found" comments mentioned that a browser window is opened. I deleted IE a while back and never clicked "make default browser" in Firefox everything's working now :D |
@dafhi Thanks! |
excellent updates recently! noticeably faster on my humble i4210u. looking forward to more |
github demos work. zip file .. not so much. black image w/ 60 fps
The text was updated successfully, but these errors were encountered: