Skip to content
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

Big FPS drop with Sprite3D as ground and 14 omnilights #2096

Closed
ScyDev opened this issue Jun 15, 2015 · 12 comments
Closed

Big FPS drop with Sprite3D as ground and 14 omnilights #2096

ScyDev opened this issue Jun 15, 2015 · 12 comments

Comments

@ScyDev
Copy link
Contributor

ScyDev commented Jun 15, 2015

In my example, the grass which is the background for everything else.
I've tried one big Sprite3D (13x26m), but noticed that this eats about 30 FPS in fullscreen, as compared to no visible ground at all.
Then I've tried many smaller sprites (2.6x2.6m) to cover the same area, which eats "only" about 15 FPS, but still way too much...
What is strange is that only the ground makes this huge difference in FPS. All the other sprites in the game seem to hardly make a difference in FPS if I enable or disable them.
All of them, including the ground, are shaded and receive shadows.

screenshot from 2015-05-28 19 44 15

@ScyDev
Copy link
Contributor Author

ScyDev commented Jun 15, 2015

The ground has always had alpha disabled, so that can't be the issue.

One diffecrence is that the ground sprite is oriented on Y axis, while all the other game objects are oriented on Z axis.

@ScyDev
Copy link
Contributor Author

ScyDev commented Jun 15, 2015

Oh wow! You won't believe this! :D

If I change the ground sprite to Z axis, the FPS drop is gone. Even with one big Sprite3D for the whole level.
So this seems to be what actually causes the performance loss. But of course this looks wrong. I still need the ground to be oriented on Y axis.

Can you fix this? Should be something obvious, right?
Or am I trying to do something here that Sprite3D wasn't meant to do?

@ScyDev
Copy link
Contributor Author

ScyDev commented Jun 15, 2015

Do you still need a scene or can you reproduce it yourself with this new info?
If you need it I will do it, but I like to prevent unnecessary work.

@reduz
Copy link
Member

reduz commented Jun 15, 2015

No, I truly have no idea what's going on, would really appreciate a test
scene :)

On Mon, Jun 15, 2015 at 12:10 PM, ScyDev notifications@github.com wrote:

Do you still need a scene or can you reproduce it yourself with this new
info?
If you need it I will do it, but I like to prevent unnecessary work.


Reply to this email directly or view it on GitHub
#2096 (comment).

@ScyDev
Copy link
Contributor Author

ScyDev commented Jun 15, 2015

Ok, working on it.

@ScyDev
Copy link
Contributor Author

ScyDev commented Jun 15, 2015

test_project_ground_sprite zip

Save this JPG and rename it to ZIP ;)

@ScyDev
Copy link
Contributor Author

ScyDev commented Jun 15, 2015

This runs at 44 FPS for me.

Hide the Ground sprite (or orient to Z axis) and you get 60 FPS.
Or hide the light sources and you get 60 FPS.

So it seems to me that if the Ground is oriented on Z axis, it receives light from only a few of the sources and that's why that affects performance. So axis orientation is not actually the cause of this problem.

But light seems to be very expensive. Roughly 1 FPS lost for every light source. Especially if they all shine on the same sprite, that's why it helped when I made the ground from many small sprites instead of one big one.

And having 2 moving light sources seems to eat about 15 FPS all by itself (not in this scene, but in my game I've noticed this).

@ScyDev ScyDev changed the title Big FPS drop with Sprite3D as ground Big FPS drop with Sprite3D as ground and 14 omnilights Jun 15, 2015
@ScyDev
Copy link
Contributor Author

ScyDev commented Jun 15, 2015

Is this the expected performance with lights?
Or am I doing something wrong?

@bojidar-bg
Copy link
Contributor

@ScyDev BTW, what happens when you disable shadows?

@ScyDev
Copy link
Contributor Author

ScyDev commented Jun 16, 2015

None of the lights in this demo are casting shadows.

@ScyDev
Copy link
Contributor Author

ScyDev commented Jun 19, 2015

I just found out, I have such extremely low FPS because I lost OpenGL support when I last updated my Ubuntu.
On my gaming PC I get about 2500 FPS in the best case.

However, the huge impact of lights is still there. In certain situations it drops from 2000 to 400 FPS.

@kubecz3k
Copy link
Contributor

Trying to triage this issue:
In the light of previous comments I'm assuming that while the issue is generally solved the 3d rendering engine still could be faster. 3d rendering will be completely rewritten in Godot 3.0 and the huge performance boost is expected in this release. Due to this I don't see the need for this issue to be opened in it's current form, so I'm archiving it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants