erichlof / THREE.js-PathTracing-Renderer

Real-time PathTracing with global illumination and progressive rendering, all on top of the Three.js WebGL framework. Click here for Live Demo: https://erichlof.github.io/THREE.js-PathTracing-Renderer/Geometry_Showcase.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

offline rendering

dafhi opened this issue · comments

commented

github demos work. zip file .. not so much. black image w/ 60 fps

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.

commented

after selecting 'open w live server'

msg box
http://127.0.0.1:5500/arctic_circle.html
application not found

mmm that's odd, I've never received that message before. Here's a screenshot of my editor. Make sure you have the latest version of Live Server extension installed (5.6.1 is the current version at the moment). It should appear in the list of extensions on left-hand side of editor.

editor

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.

editor2

commented

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
Yay! Glad everything is working now! Yes it should work with any modern browser such as Chrome, Firefox and even Microsoft Edge (provided that you install the Edge Dev channel version that mirrors the WebGL 2.0 support of Chrome - my project demos all require WebGL 2.0 support).

Thanks!

commented

excellent updates recently! noticeably faster on my humble i4210u. looking forward to more