Poll

Optimize Blockland Shaders

Yes
Yes
Yes

Author Topic: Optimize Blockland Shaders FFS  (Read 4881 times)

Just a straightforward poll
I've found the Blockland shader effects to be horribly optimized and cumbersome, mostly due to shadows being casted upon emitters, and an endless shadow draw distance.

If the shaders are optimized, there could be more better looking effects, shadows could be sharper, lights casting dynamic shadows, real time reflections, the possibilities are endless!

Maybe there could be actual Volumetric lighting instead of having to rely on emitters to do the job.

I'm sure Badspot and kompressor have spent ages optimizing the shaders.

I've found the Blockland shader effects to be horribly optimized and cumbersome, mostly due to shadows being casted upon emitters
Particles don't contribute much to the performance loss. Not every build even has particles.

and an endless shadow draw distance.
So you'd rather have a small circle around you where shadows are visible and rest doesn't? I'd rather take pixely shadows than that.

If the shaders are optimized, there could be more better looking effects, shadows could be sharper
Higher shadow texture resolution. Worse performance.

lights casting dynamic shadows
http://forum.blockland.us/index.php?topic=184263.msg4923357#msg4923357
Orders of magnitude worse performance.

real time reflections
You sir are insane. You'd need to render the scene again on top of the shadows + I feel like reflections take more juice to render than shadows.

the possibilities are endless!
Not even close.

Maybe there could be actual Volumetric lighting instead of having to rely on emitters to do the job.
I believe Unreal Engine 4 is the only engine capable of producing real-time volumetric lighting at the moment. It isn't in even released yet and the engine has been in development for longer than this game has existed. It probably isn't even possible to have real-time volumetric lighting on any Torque engine not mention on an ancient one.

Simply "optimizing" or completely removing shaders isn't going to result in an enormous performance boost that would make any of this possible.

optimization is a broad term now isn't it

You sir are insane. You'd need to render the scene again on top of the shadows

No you don't, the reflection could simply reflect just the world around the brick and have a static reflection.


So you'd rather have a small circle around you where shadows are visible and rest doesn't? I'd rather take pixely shadows than that.

Maybe the shadows could be culled so they look good up close but bad far away?


"lights casting dynamic shadows"
Orders of magnitude worse performance.

Only if the light entity is moving. You see shadows don't really put much stress on my machine, it's just when it renders shadows on massive builds, and when the shadows are moving, I like to play with the day/night cycle off, so the shadows casted upon the world don't move, so there's not much stress on my rig, because it's not trying to calculate millions of shadow instances moving.

So having shadows casted upon animated moving particles like FogA will definitely make your computer chug.


It probably isn't even possible to have real-time volumetric lighting on any Torque engine not mention on an ancient one.

Who says they have to be dynamic? Maybe after you finish your build you could go into the environment menu and click "Render sunrays", which will create static faked light rays like this

Christ you're a dumbass

Demian told you that almost every suggestion you made would cause the scene to be rendered many more times than its current amount (rendering the scene more than once causes shaders to be laggy), and you ignored that and tried to justify your terrible and unfounded ideas

Here is your problem: 43809
Also Treynolds/Demian is right, doing all that would just take more to render.

No you don't, the reflection could simply reflect just the world around the brick and have a static reflection.
Then you're talking about cubemaps. These are indeed supported but if Badspot wanted them (reflections) they would be in the game already. Even so the scene would still need to be rendered again for the cubemap image.

Maybe the shadows could be culled so they look good up close but bad far away?
The only good idea from you in this thread. This could be neat if it was done properly but I highly doubt that. I feel like it would hit performance even more since you need to first render low res shadows for far away, then medium shadows, and finally high resolution shadows.

Only if the light entity is moving.
Now I'm purely making an educated guess. If you have dynamic shadows implemented you are still recalculating the shadows every frame even though the light isn't moving. It doesn't help that the light isn't moving.

You see shadows don't really put much stress on my machine, it's just when it renders shadows on massive builds
Exactly. Even I can run Jetpuff Towers on max at 40 FPS or so but show me a single good server that has ~2k bricks. In Blockland it's all about the quantity of bricks.

and when the shadows are moving
Now I'm purely guessing but I don't think moving shadows have that great a performance hit. Some perhaps but not a lot.

So having shadows casted upon animated moving particles like FogA will definitely make your computer chug.
I have no clue if this is true so I'm going to try this out today and post results here.

Who says they have to be dynamic? Maybe after you finish your build you could go into the environment menu and click "Render sunrays", which will create static faked light rays like this
I can't think of a method to bake 3D volumetric lighting. It might be possible with Roblox style 3D texture but I'm not sure. The old way of doing this was to make 3D models with textures. I don't think Badspot wants to waste time on that.

Christ you're a dumbass
Right back at ya

Then you're talking about cubemaps. These are indeed supported but if Badspot wanted them (reflections) they would be in the game already. Even so the scene would still need to be rendered again for the cubemap image.
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!) and the brick(s) take a snapshot of the bricks around them and save those with the save, maybe now saves are in folders, but I think that would be a pain in the ass to access. Maybe there's a save folder, a save screenshot folder, and a save cubemap folder.
EDIT: And a pre-rendered volumetric lighting file folder


The only good idea from you in this thread. This could be neat if it was done properly but I highly doubt that. I feel like it would hit performance even more since you need to first render low res shadows for far away, then medium shadows, and finally high resolution shadows.
You think it'll have a larger performance hit to cull out shadows rather than rendering non-culled high-resolution shadows? *facepalmtree*

Now I'm purely making an educated guess. If you have dynamic shadows implemented you are still recalculating the shadows every frame even though the light isn't moving. It doesn't help that the light isn't moving.
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.

Exactly. Even I can run Jetpuff Towers on max at 40 FPS or so but show me a single good server that has ~2k bricks. In Blockland it's all about the quantity of bricks.


Now I'm purely guessing but I don't think moving shadows have that great a performance hit. Some perhaps but not a lot.


I have no clue if this is true so I'm going to try this out today and post results here.
Yeah it's pretty laggy


I can't think of a method to bake 3D volumetric lighting. It might be possible with Roblox style 3D texture but I'm not sure. The old way of doing this was to make 3D models with textures. I don't think Badspot wants to waste time on that.
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.
This gives me another idea, you should be able to add events to the shadows, this would open up alot of possibilities, like a new Vampires vs Nightwatch gamemode where if vampires get hit by the shadows they get the BurnPlayer effect.
« Last Edit: July 01, 2013, 09:34:30 AM by BDX777 »

Oh wow, this is not going to end well...

EDIT: Are you trolling?, you're the same person that tried to tell someone he wasn't allowed to sig you without your permission.
« Last Edit: July 01, 2013, 09:38:30 AM by Conservative »

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!

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!
Sounds interesting but try clearing the bricks after you render dem shadows.

Sounds interesting but try clearing the bricks after you render dem shadows.

...You would obviously re-render the shadows if the scene changes. Easy.

I have no clue if this is true so I'm going to try this out today and post results here.
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.

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!
Exactly: http://forum.blockland.us/index.php?topic=217670.0

EDIT: Are you trolling?, you're the same person that tried to tell someone he wasn't allowed to sig you without your permission.
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.



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!)
Technically they are called cuboids.

and the brick(s) take a snapshot of the bricks around them
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.)

You think it'll have a larger performance hit to cull out shadows rather than rendering non-culled high-resolution shadows? *facepalmtree*
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.

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.
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

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.
Sun rays have nothing to do with radiosity/global illumination and that image has nothing to do with sun rays.
« Last Edit: July 01, 2013, 10:37:29 AM by Demian »

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.

EDIT: Are you trolling?, you're the same person that tried to tell someone he wasn't allowed to sig you without your permission.
No.

...You would obviously re-render the shadows if the scene changes. Easy.
Yes but I was just pointing out how shadow maps would stay, alongside the pre-rendered sun rays.

ok maybe you have 1 or 2 good points but nobody is gonna take the time to make them probably