Blockland Forums > Suggestions & Requests
Optimize Blockland Shaders FFS
BDX777:
--- Quote from: Zeblote on July 01, 2013, 09:44:10 AM ---How about baked shadows?
Rendering shadows for every brick every frame is stupid. Bricks don't move and the sun doesn't either. So render those shadows one time, save the map. And then render dynamic shadows only for players, vehicles and projectiles!
--- End quote ---
Sounds interesting but try clearing the bricks after you render dem shadows.
Zeblote:
--- Quote from: BDX777 on July 01, 2013, 09:47:04 AM ---Sounds interesting but try clearing the bricks after you render dem shadows.
--- End quote ---
...You would obviously re-render the shadows if the scene changes. Easy.
Demian:
--- Quote from: Demian on July 01, 2013, 05:43:38 AM ---I have no clue if this is true so I'm going to try this out today and post results here.
--- End quote ---
I used the fog B emitter and shadows at max. I tried in Gazebo garden with ~10 emitters and had no FPS drop. (Both ran at 49 FPS.) It was a small save so it was to be expected. Then I loaded Afghanistan and made almost all the baseplates and roads have the fog B emitter (roughly 50 emitters or so) and stood in two spots with and without the emitters.
In the first spot I could see about third of the town so there were maybe 20 emitters visible running at 29 FPS and without at 30 FPS.
In the second spot I was at street level inside the fog looking down the street with more fog and shadows: with emitters I had about 26 FPS and without 29 FPS.
With this small test I'd say emitters do cause minor FPS drop, but it's nothing to be worried about.
--- Quote from: Zeblote on July 01, 2013, 09:44:10 AM ---How about baked shadows?
Rendering shadows for every brick every frame is stupid. Bricks don't move and the sun doesn't either. So render those shadows one time, save the map. And then render dynamic shadows only for players, vehicles and projectiles!
--- End quote ---
Exactly: http://forum.blockland.us/index.php?topic=217670.0
--- Quote from: Conservative on July 01, 2013, 09:35:39 AM ---EDIT: Are you trolling?, you're the same person that tried to tell someone he wasn't allowed to sig you without your permission.
--- End quote ---
I don't think he's a troll. I've checked out his YouTube channel and website and judging by those + his name, logo, and so forth I'd say he's just a dumb kid at around 10-12 years old who genuinely think these are good ideas. Visually this stuff would be amazing to have in Blockland but it's simply not practical.
--- Quote from: BDX777 on July 01, 2013, 09:30:04 AM ---Yeah you paint a brick with a Cubemap spraycan (It would totally fit 'cause the name is Cube and the game is filled with a bunch of square bricks!)
--- End quote ---
Technically they are called cuboids.
--- Quote from: BDX777 on July 01, 2013, 09:30:04 AM ---and the brick(s) take a snapshot of the bricks around them
--- End quote ---
Terrible idea. Works great with under 10 reflective bricks but if this were implemented people would use it a lot more than that. Rendering a cubemap for each brick that is reflective would produce mostly accurate reflections but it would bloat the game directory size as every brick needs 6 images for reflection. Those images also need to be downloaded from online servers as well. Implementing cubemaps means every client connecting to any server with reflective bricks needs to download those 6 images per reflective brick. (Using the system you suggested.) It would increase load times but the performance hit wouldn't be too terrible. Noticeable, but not crippling. (Just an educated guess.) Mind you when rendering the cubemaps there would be very noticeable FPS drops. Considering the cubemaps would need to be re-rendered when any bricks in proximity change.. not a good idea.
Better idea, but not as accurate, would be to use user defined cubemaps. That way you could have several bricks using a single cubemap. (This is how modern games do it, one room has one cubemap rendered at the middle of the room and all reflective things in said room use that. Larger rooms can use several or if there is only reflective stuff at one place then render the cubemap closer to that area rather than the center of the room.)
--- Quote from: BDX777 on July 01, 2013, 09:30:04 AM ---You think it'll have a larger performance hit to cull out shadows rather than rendering non-culled high-resolution shadows? *facepalmtree*
--- End quote ---
The way I imagine this system would work is by rendering three shadow maps at three different resolutions and then overlaying them around the player in a circular fashion. The higher resolution the shadow map is the smaller it is but overall I'd guess that the system would have a similar performance hit as rendering two/three medium quality shadow maps using the current system. There might be other ways of doing this but I don't know how those would work.
--- Quote from: BDX777 on July 01, 2013, 09:30:04 AM ---Look at this video, but ignore all the "Euclideon Unlimited Detail is a hoax!" BS, just listen to the technical crap.
https://www.youtube.com/watch?v=8vGXqXL7zrI
EDIT: I'm saying that when the dynamic lights aren't doing anything they could slow down the recalculation as optimization.
--- End quote ---
I'm not sure what you mean. The guy in the video is talking about baked lighting which is commonly used in games (old and new) and in terms of Blockland it would mean baked shadows which I've posted about in detail over here: http://forum.blockland.us/index.php?topic=217670.0
--- Quote from: BDX777 on July 01, 2013, 09:30:04 AM ---I think you should also be able to use the wrench on them as if they were bricks so you can add a light to these pre-rendered sun rays and make it look like Radiosity mapping.
--- End quote ---
Sun rays have nothing to do with radiosity/global illumination and that image has nothing to do with sun rays.
BDX777:
--- Quote from: Demian on July 01, 2013, 10:32:49 AM ---Terrible idea. Works great with under 10 reflective bricks but if this were implemented people would use it a lot more than that. Rendering a cubemap for each brick that is reflective would produce mostly accurate reflections but it would bloat the game directory size as every brick needs 6 images for reflection. Those images also need to be downloaded from online servers as well. Implementing cubemaps means every client connecting to any server with reflective bricks needs to download those 6 images per reflective brick. (Using the system you suggested.) It would increase load times but the performance hit wouldn't be too terrible. Noticeable, but not crippling. (Just an educated guess.) Mind you when rendering the cubemaps there would be very noticeable FPS drops. Considering the cubemaps would need to be re-rendered when any bricks in proximity change.. not a good idea.
Who says the cubemaps have to update when you build near them? You could simply use a tool to select the bricks you want to have create reflections and they'll share the same cubemap reflection. As for size, downsize them by %50.
Better idea, but not as accurate, would be to use user defined cubemaps. That way you could have several bricks using a single cubemap. (This is how modern games do it, one room has one cubemap rendered at the middle of the room and all reflective things in said room use that. Larger rooms can use several or if there is only reflective stuff at one place then render the cubemap closer to that area rather than the center of the room.)
Precisely.
The way I imagine this system would work is by rendering three shadow maps at three different resolutions and then overlaying them around the player in a circular fashion. The higher resolution the shadow map is the smaller it is but overall I'd guess that the system would have a similar performance hit as rendering two/three medium quality shadow maps using the current system. There might be other ways of doing this but I don't know how those would work.
I'm not sure what you mean. The guy in the video is talking about baked lighting which is commonly used in games (old and new) and in terms of Blockland it would mean baked shadows which I've posted about in detail over here: http://forum.blockland.us/index.php?topic=217670.0
No I mean when the dynamic light entity is still for 30 seconds, it would slow down re-calculation dramatically (Probably by %95) and act as a pre-rendered shadow. Only updating when reset with the wrench, unless the player has told it to update every second.
Sun rays have nothing to do with radiosity/global illumination and that image has nothing to do with sun rays.
No I was just pitching another idea, the ability to use your wrench on the pre-baked sun rays and adding a light from the ambient light addon making it look like the sunlight is bouncing off of everything.
And I was also saying how cool it would be to be able to do the same with the shadows from the shader update, so you could make a vampire vs vampire hunter TDM where sunlight hurts the vampire team.
--- End quote ---
--- Quote from: Conservative on July 01, 2013, 09:35:39 AM ---EDIT: Are you trolling?, you're the same person that tried to tell someone he wasn't allowed to sig you without your permission.
--- End quote ---
No.
--- Quote from: Zeblote on July 01, 2013, 09:54:36 AM ---...You would obviously re-render the shadows if the scene changes. Easy.
--- End quote ---
Yes but I was just pointing out how shadow maps would stay, alongside the pre-rendered sun rays.
Titanium Man:
ok maybe you have 1 or 2 good points but nobody is gonna take the time to make them probably