AccueilAccueil  FAQFAQ  RechercherRechercher  S'enregistrerS'enregistrer  MembresMembres  Connexion  

Partagez | 
 

 CBNA SmartLight

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
vinter93
Nouveau


Messages : 8

MessageSujet: CBNA SmartLight   Mar 5 Juil 2016 - 17:46

Hello!

First, sorry for speaking in english, my french is very bad.

I've been trying to use CBNA SmartLight engine in my project.

I managed to get it working!

I got one light following the player and some shadows.

I get around 400fps.

I also deleted all the code to the time of the day (to optimize the engine) because in my case i dont need it.

The problem is that if i add another light the fps drops a lot.

I get around 50fps with two lights.

A very big drop.


Does anyone knows how to optimize this engine?

I really like it, it looks great but it so slow Sad


Any help would be welcome!
Revenir en haut Aller en bas
arthuro
Utilisateur confirmé: Rang ****
avatar

Messages : 1313
Localisation : Grenoble / Méribel
Projet Actuel : CBNA

MessageSujet: Re: CBNA SmartLight   Mar 5 Juil 2016 - 19:09

Hi vinter93,

I haven't used CBNA Smartlight so far. But I can help you

Are you sure your modifications you made to the engine are related to the fps decrease ?
I think it is juste because of the second light.

You compare two situations :
1) 1 lights
2) 2 lights + your modifications to the engine.

What happen in theses cases :
3) 2 lights
4) 1 lights + your modification to the engine.

if 1) ~ 4) and 2) ~ 3). The problem isn't caused your modifications to the CBNA Smartlight
else send us your modifications.


By the way, light engine with shadows are often very costly. 50 fps is not so bad.

_________________

D'autres jeux :
In The Cube
In the cube 2
Revenir en haut Aller en bas
vinter93
Nouveau


Messages : 8

MessageSujet: Re: CBNA SmartLight   Mar 5 Juil 2016 - 21:33

I didnt understand your examples very well but ill try to explain.


When i implemented the engine to my project (no customization) i was geting around 40-50fps with one light.


Then i did some editing in the code (deleted the time of day and some other things and custumized the light settings) and i got those 400fps.

Then with another light it drops to 40-50 again...
Revenir en haut Aller en bas
vinter93
Nouveau


Messages : 8

MessageSujet: Re: CBNA SmartLight   Mar 5 Juil 2016 - 21:39

Also i should mention that im using some very bbig streched sprites.

I dont know if that causes any lag to the engine but it may be an important detail.

The map is realy big..

My room is 720p resolution but the map goes out of bounds by a large margin.

In this map sprite i have the collision mask (i guess the engine casts shadows using this collision mask or the sprite itself, i dont know).

This map is basically paths, limits and stuff like that so that the player has some limitations to were to go.

And this map is set to a object and this object is set to cast shadows
Revenir en haut Aller en bas
Asu
Utilisateur confirmé: Rang ****
avatar

Messages : 893

MessageSujet: Re: CBNA SmartLight   Mer 6 Juil 2016 - 8:18

vinter93 a écrit:
Also i should mention that im using some very bbig streched sprites.

I dont know if that causes any lag to the engine but it may be an important detail.

The map is realy big..

My room is 720p resolution but the map goes out of bounds by a large margin.

In this map sprite i have the collision mask (i guess the engine casts shadows using this collision mask or the sprite itself, i dont know).

This map is basically paths, limits and stuff like that so that the player has some limitations to were to go.

And this map is set to a object and this object is set to cast shadows
For every light, the Smartlight engine draws all entities that could be shadowed on a surface and redraws that surface several times with larger and larger scales to draw it out on the screen, which is actually lighter than most GM lighting engines that acheives the same effect (GM being inherently slow, offloading large work to the GPU is lighter than a bit of work on the CPU).

I don't think it does use collision masks. But it probably rather draws every sprite with the color (RGB, excluding alpha) zeroed (or maxed depending on its internal behaviour)

What GPU do you have?

_________________
<BB[Work]> D-z, y fait pleurer tellement il est beau
Revenir en haut Aller en bas
vinter93
Nouveau


Messages : 8

MessageSujet: Re: CBNA SmartLight   Mer 6 Juil 2016 - 16:20

I have a gt520.

I know its not great but this never happened to me in other engines...
Revenir en haut Aller en bas
vinter93
Nouveau


Messages : 8

MessageSujet: Re: CBNA SmartLight   Mer 6 Juil 2016 - 16:22

You said it redraws the sprite several times..

Maybe the slowdown comes from there!

Because im using very large sprites.
Revenir en haut Aller en bas
vinter93
Nouveau


Messages : 8

MessageSujet: Re: CBNA SmartLight   Mer 6 Juil 2016 - 17:32

UPDATE:

Ive been messing around and got some increases in fps.

I can now have two lights in the screen with around 200fps.


But if move to a specific place were 3 lights appear on the screen the fps drop to 50 again...

I dont think the shadow causes the drop because i deleted the code so that no shadows are casted from the big sprites and i got around 5-10fps more...

It drops when i have more than two lights on screen...

For the performance boosts i edited the sl_buffer_texturesize from 1 to 0.1 and i had a memory leak in a piece of code for some particles that is now fixed.


Now i think the problem comes from having more lights on screen


Also using xscale and yscale on the light causes lag.. if i dont scale i have some fps boosts.

EDIT i was wrong... deleting the code for casting shadows on the big sprites increases the performance by 150fps.
But the problem with 3 lights on screen remains..

It goes from +/-200fps to 50
Revenir en haut Aller en bas
vinter93
Nouveau


Messages : 8

MessageSujet: Re: CBNA SmartLight   Mer 6 Juil 2016 - 17:59

I finally did it :O

minFPS, maxFPS, avgFPS
110, 661, 450


Unfortunately i was only abble to set one light to cast shadows on objects but after editing some scalings it kinda does what i had in mind.

Anyway, if there is some other sugestions feel it would be apreciated!
Revenir en haut Aller en bas
Contenu sponsorisé




MessageSujet: Re: CBNA SmartLight   

Revenir en haut Aller en bas
 
CBNA SmartLight
Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» CBNA SmartLight - Moteur de lumière
» CBNA Smartlight avec Game Maker Studio
» Questions sur CBNA SmartLight
» Un IRC pour le CBNA?
» [Minecraft] TexturePack Le CBNA ?

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
Forum Le CBNA :: Développement :: Game Maker-
Sauter vers: