Closed EtagiBI closed 5 years ago
@erichlof congratulations! let's close the thread :)
the last question, how many vertices/polygons can handle the 2048x2048 texture?
Now...could you build a demo with a full scene of an interior space using many polygon models and many lights? Something like n2k3 showed us, but with furnitures and textures?
@MEBoo Hi! Currently I am using 7 rgba slots for each triangle. The way I figured that is: 3 vertices per triangle, times 3 x, y , and z coordinates for each vertex, that's 9. Plus 3 x, y, and z normal directions for each vertex, so that's + another 9. Then 2 u and v coordinates for textures/materials for each vertex, so that's + 6. Then pbr specs for the entire face, so stuff like MaterialType_ID, Index of Refraction, roughness, metalness, so that's another 4 values. So all together that's 9 + 9 + 6 + 4 = 28 values. Each texture slot has 4 values it can store - r,g,b,a. So the way I figure it, that's 7 texture slots times 4 possible values = 28. That's where I'm getting the total of around 7 texture slots for each complete triangle. Now a 2048 * 2048 texture has 4,194,304 rgba slots, but we have to divide that by 7 to fit all the triangle data for each triangle. So that works out to around 600,000+ faces you can have in one scene. If it has to be more than that, then we can bump up the texture size to 4096x4096, which gives us 16,777,216 slots for a grand total of (divided by 7 again) = just shy of 2,400,000 faces. The reason I currently have 2048x2048 textures in the demos is because I had initially thought that I was going to be able to load the models on mobile and not all mobile platforms support those huge 4096 textures. But even the simple BVH demos don't work on my Samsung Galaxy 7 anyway (maybe they do on a Galaxy 9, I don't know), so in the future we can just bump up the textures to 4096 and leave mobile behind (just for those type of heavy BVH demos and projects).
About the room demo, yes that would be the ultimate if we could have any number of lights and a lot of triangles in the scene at the same time. n2k3 is defintiley pushing it forward in the right direction, his awesome apartment model has 100,000+ triangles and a cool loading animation. Let me merge his project and then maybe we can work towards that by adding numbers of lights. After adding all that, it will probably only run at 10 fps in the browser, but hopefully it will run, compile every time, and at least be somewhat interactive. :)
@erichlof good & cool!!
Maybe will run at 10fps today... but hey this project is for the future ;) And 10fps with which video card? I have a 1080ti to try ... let me try :D
@MEBoo Just curious - what framerate do you get on the Difficult light demo above with the 3 teapots added in now? I have a Toshiba laptop with integrated Intel graphics that gets 29-30 fps but I was wondering what you would get with a dedicated graphics card?
I'm closing out this issue now, but you can still reply to it if you like. :D
Thanks to all involved!
@MEBoo I'm here! Couldn't test these days :( 60 fps ... maybe more but webgl is capped ;) I get 60 fps also on the new GLtf viewer demo (even with pixelRatio = 1 on a 2560x1440p monitor, don't know if resolution is correlated to fps)
The only way to drop fps is to go into the space in photo
@MEBoo Wow that's fantastic! I had no idea the amount of speed up a dedicated graphics card could give! On my humble laptop with Intel integrated graphics I was getting 20 to 30 fps inside the house with pixel ratio even lowered to 0.5. If I increased it to 1.0, it would maybe achieve 7 or 8 fps, lol.
Well it's comforting to know that users with better systems will achieve real time results heading toward 60 fps, rendering 100,000 plus triangles, all inside a browser!
That's also a nice confirmation and testament to the BVH builder and transversal code that was inspired by previous authors and custom fit for this project.
Thank you for posting the results! :-D
Hello,
First of all, I would like to thank you for all your efforts! Your project seems to be the only one alive project dedicated to Three.js photorealistc rendering.
As for my question, is it possible to render multiple OBJ models with your PTR? My friend and I are working on a Three.js based room planner as our university project. We have a bunch of textured furniture models with different material determined via corresponding MTL files. Is this feature supprted by PTR? As I can see from your demos, at the moment PTR works with simple shapes only.