[Solved ]Large wall with tga alpha kills frame rate, why?

Posted By: Anonymous

[Solved ]Large wall with tga alpha kills frame rate, why? - 04/28/15 07:00

I have a level with a giant wall that has a .tga alpha texture.
Frame rate drops from 60(locked) to 24 when it is in sight. Why, and what can I do? I know I have a under powered laptop with a Intel GPU base.

Thanks for any help.
Mal
Posted By: DLively

Re: Large wall with tga alpha kills frame rate, why? - 04/28/15 09:16

how big is the texture? Are you scaling it at runtime? how many verts / polygons does it have?
Posted By: Anonymous

Re: Large wall with tga alpha kills frame rate, why? - 04/28/15 14:19

2 polys 4 verts, I believe do to the wall size and low olys that YES the texture is scale up.

Other info - Objects behind the wall are extremely far away.
Posted By: 3run

Re: Large wall with tga alpha kills frame rate, why? - 04/28/15 14:24

Malice I think problem is not related to the scaled big wall with alpha texture, maybe something related to those 'far away' objects? Are they out of the clipping range? Cause I don't really see any reason for a simple model with alpha texture to 'kill' framerate. I'm using a lot of models/sprites with alpha texture and never faced such problems.

Originally Posted By: Malice
2 polys 4 verts
Why don't you use sprite instead? It will looks like the model but will render faster I guess.

Greets
Posted By: Anonymous

Re: Large wall with tga alpha kills frame rate, why? - 04/28/15 14:39

Ok I will test the suggestion. Thanks ALL.

@3run the model exceeds 4000 units in length so I believe a sprite would not be allowed. However it is to large either ways so I will replace it with both 1024 long models and sprites to see what gives the best results.
Posted By: 3run

Re: Large wall with tga alpha kills frame rate, why? - 04/28/15 14:45

Originally Posted By: Malice
@3run the model exceeds 4000 units in length so I believe a sprite would not be allowed. However it is to large either ways so I will replace it with both 1024 long models and sprites to see what gives the best results.
What you mean by units? Quants? Having one sided model with 4 vertexes and with size bigger than 4000 quants won't kill framerate too I think. What is the size of the skin you use for that model? Simply create sprite and scale it up! Let's say sprite with size 1024x256 (wide image for landscape) placed in exact the same position and scaled up too 4000 quants, it won't kill the framerate!

BTW about 4000 quants, make sure you set clipping settings for camera, so objects far than let's say 5000 (it could be different value of course, depends on how far you would like to see things) quants aren't going to be visible. I remember I had same problem at the very beginning when I used to spent more time on creating levels and placing models (without LODs) all over the place, then suddenly fps used to drop bellow 40-30 frames, only cause they used to get visible all at the same time without LODs, with shadows etc.

Greets!
Posted By: DLively

Re: Large wall with tga alpha kills frame rate, why? - 04/28/15 16:10

Sounds to me like your camera is trying to render everything off in the distance. I noticed in my old days of programming, that if I made a level on a flat ground I wouldnt have any rendering issues.
But as soon as I introduced a second layer to the ground, the fps would begin dropping.

Your model is off in the distance - what size is the texture? if its way out in the distance the camera may be trying to render everything all at once and is jamming things up.

try giving it a smaller texture just for debugging. ( iassume its big enough if your need to see texture 4000 quants away with any fine detail)
Posted By: rayp

Re: Large wall with tga alpha kills frame rate, why? - 04/28/15 16:26

Quote:
But as soon as I introduced a second layer to the ground, the fps would begin dropping.
Noticed that too. Dont know how often i wondered about dropping framerates btw. If the WMP is not centered well in WED this might cause framerate drops aswell, i noticed.

Wondering if the DDS format ( 4ex ver5 with alpha support ) might help you in this case?

Greets
Posted By: Anonymous

Re: Large wall with tga alpha kills frame rate, why? - 04/28/15 18:41

THANKS to ALL for the replys

The issue turned out not to be the wall, but instead a high detail model in front of the camera when looking at the wall. The TGA and wall side and distance objects had zero effect, however if this detailed object was close to the camera and covering a large part of the screen, frame rates died.

Thanks you all
Mal
Posted By: Anonymous

[REOPENED]Sun and Ambient light kill frame rate - 04/28/15 21:45

So before I thought this was do to transparency. However, setting the sun in WED to black and it's angles 0,0 - With ambient light set to a higher white. While facing the sun(that I thought would be turned off) causes the frame rate to drop to under half (24 fps). Is there any reason why, or is this a bug??

Thanks
Mal
Posted By: 3run

Re: [REOPENED]Sun and Ambient light kill frame rate - 04/28/15 21:48

Please post a screenshot while facing the wall with debug mode on. There is also 'sun_light' that affects everything, but I'm pretty sure none one of them has to do anything with the framerate drop.

Best regards!
Posted By: Anonymous

Re: [REOPENED]Sun and Ambient light kill frame rate - 04/28/15 21:59

It will take some time to re-break my project and take a screen shot. But I can tell you that the sun and ambient setting caused the problem. Setting them back to the default values my project now runs back at 60 fps.
But from the debug panel I can tell you while facing that sun-point/wall the default REF. jumps from 15 to over 30ms.
Posted By: DLively

Re: [REOPENED]Sun and Ambient light kill frame rate - 04/28/15 22:02

At the risk of sounding redundant, whats your clip_far set to? Is there anything in the sky, or camera view when looking at the sky? Can you make it lag anywhere else? as 3run said, a debug panel would be nice to see.

Does this only happen when you look at the sky and you change the parameters in WED? or

Or does this happen when during (after) WEDs parameters are change.
Posted By: 3run

Re: [REOPENED]Sun and Ambient light kill frame rate - 04/28/15 22:04

Malice@ if you don't want to make it public, you can pm me with the screenshot and more details. I'll try to help. About sun and ambient... maybe you are using shaders or something (just a wild guess), cause it should not normally kill framerate.

Greets
Posted By: DLively

Re: [REOPENED]Sun and Ambient light kill frame rate - 04/28/15 22:06

Agreed with 3run.. at a guess I can only think of shaders as a final guess, without seeing more of your project...

If you don't want to display your game, you can create a small demo that recreates the bug / undesired effect.
Posted By: Anonymous

Re: [REOPENED]Sun and Ambient light kill frame rate - 04/28/15 22:16



@3run no shaders in uses...

Link to Image. However, using sun_light =0; and setting ambient light fixes the issue.

Event with normal sun defaults fps are 60 and REF is about 3-4 ms

best results of the screen shots

EDIT links removed
Posted By: 3run

Re: [REOPENED]Sun and Ambient light kill frame rate - 04/28/15 22:33

I'm not sure about sun and ambient, but there is something terribly wrong with your functions, take a look at FNC ('time for script execution'):

This value normally is bellow 0.9 (some times it's of course bigger, but only for really complex projects!)...

As an alternative, take a look at this (55 loops running and only 0.3 for script execution):

That's probably one of the main reasons for the framerate drop!

F.e. take a look at this complex scene by sivan's map editor:


So first of all, you need to look throw your code, and make sure that execution time get's lower. After that we'll need to dig more into your sprites and models, cause I don't really see any reason for REF being around 72..

Edit: on the last picture FNC is 5.0... O_o can you please send this project to me via PM? I won't share/use it in any ways, I just want to take a closer look and find out wft is going on there.
Posted By: Anonymous

Re: [Solved]Sun and Ambient light kill frame rate - 04/28/15 22:40

The crazy numbers in pic1 are a result of me rapid taping the screen shot button use the numbers for shot pic 2.


EDIT - HAD the camera loop in the player - Stupid me!

Thanks for all the help
Mal
Posted By: 3run

Re: [Solved]Sun and Ambient light kill frame rate - 04/28/15 22:41

Originally Posted By: Malice
EDIT - HAD the camera loop in the player - Stupid me!
So the camera loop in the player's loop was the reason? grin
I'm really glad if that solved the problem! laugh

Greets!
Posted By: Anonymous

Re: [Solved]Sun and Ambient light kill frame rate - 04/28/15 22:44

I watched my function climbing into the thousands lol...
Posted By: 3run

Re: [Solved]Sun and Ambient light kill frame rate - 04/29/15 06:17

Hehe grin I remember how I suffered from same mistakes by myself! Keep it up! laugh

Best regards!
Posted By: DLively

Re: [Solved]Sun and Ambient light kill frame rate - 04/29/15 07:18

I too suffered the same mistakes myself, but we all survive through it grin
Posted By: Anonymous

Re: [Solved]Sun and Ambient light kill frame rate - 04/29/15 14:27

Thanks for the Help y'all. I also found 2 wild ent_creates that were running every second or so.

These are the thing that happen when you are coding every day and not organizing or commenting. You make mistakes and can't find them easily.

P.S @3run your PM box is full
Posted By: 3run

Re: [Solved]Sun and Ambient light kill frame rate - 04/29/15 18:33

Originally Posted By: Malice
P.S @3run your PM box is full
I've removed some of my older messages. Try to PM me again!
© 2024 lite-C Forums