I examined the patch before you sent this mail and I have been discussing
a few possible solutions. I think the best solution would be to draw the text
on a texture in advance and then you can in the render phase just draw textures
in 3D mode. Given that most text on billboards doesn't change every frame
this should give a considerable speedup.

Greetings,

On Wed, Sep 17, 2008 at 1:58 PM, Pablo Martin <[EMAIL PROTECTED]> wrote:
> Ill clarify about the cel patch (and i think the info is good to know
> for all cs users too).
>
> I didn't commit it yet, because the patch changes billboard-text drawing
> order in an incorrect way (explanation below). It is not a problem with
> no billboard overlap, but it is not 100% correct.
>
> The speed problem comes from the way 3d and 2d is used, basically, the
> code is now calling BeginDraw(3D), BeginDraw(2D) and then BeginDraw(3D)
> again for every billboard. Changing this to just switch once for all
> billboards makes it a lot faster, ie:
>
> 1- call begindraw(3d)
> 2- draw all images.
> 3- call begindraw(2d)
> 4- draw all text
> 5- call begindraw(3d)
>
> The problem with this, is text is now always on front, while before it
> would be ensured billboards on top would overwrite lower ones completely.
>
> The patch was a "concept proof" (trying to find where the speed problem
> was) which is good for Piotr for now, as it helps him to work, but to be
> commited i would like to change all code to draw using 2d calls, thus
> avoiding the context switch (based on what the code does, it seems
> possible, but some of the maths have to be changed), and keeping the
> drawing order "correct". Maybe using some kind of clipping would be even
> better.
>
> I'd like to fix this at this moment, but i had some travelling and other
> things to do in the middle. If someone else wants to finish this,
> though, feel free :)
>
> In general, this also means we should investigate and minimize 2d/3d
> switches, as at least in some systems slows down the app greatly.
>
> Greetings!
>
>  Pablo
>
> Jorrit Tyberghein escribió:
>> Hmm, caedes has commit access to CEL. If this gives a speedup to billboards
>> then why didn't he commit it? In other words: what is the catch?
>>
>> Greetings,
>>
>> On Wed, Sep 17, 2008 at 10:19 AM, Piotr Podgórski
>> <[EMAIL PROTECTED]> wrote:
>>
>>> Hey Jorrit,
>>>
>>> I misunderstood, sorry. Yes, that patch is only CEL related. What it
>>> fixes is the framedrop when using CEL billboards - I just didn't
>>> notice Jim's problem was in plain CS. Next time I'll make sure to wake
>>> up before posting something on the net ;D. Again, sorry for the
>>> confusion guys.
>>>
>>> Greets
>>>
>>> 2008/9/17 Jorrit Tyberghein <[EMAIL PROTECTED]>:
>>>
>>>> Piotr, in Jim's first mail he told us he copied code from walktest to
>>>> draw the pixmaps.
>>>> So I don't think he is using CEL. Also I fail to see the relevance of
>>>> that patch? What
>>>> does your patch fix?
>>>>
>>>> Greetings,
>>>>
>>>> On Wed, Sep 17, 2008 at 9:23 AM, Piotr Podgórski
>>>> <[EMAIL PROTECTED]> wrote:
>>>>
>>>>> Hi there,
>>>>>
>>>>> Jim, are you using CS/CEL 1.4? If so, probably you have the same
>>>>> problem that I had. Caedes wrote a patch to fix that, but I think the
>>>>> changes from it were only commit to trunk and not 1.4. I append the
>>>>> patch to this mail. Hope it helps.
>>>>>
>>>>> Cheers
>>>>>
>>>>> 2008/9/17 Jorrit Tyberghein <[EMAIL PROTECTED]>:
>>>>>
>>>>>> What kind of image is it that you're drawing on the screen? Is it a
>>>>>> power of two?
>>>>>> Does it contain transparency? I think you should avoid a big single 
>>>>>> screen-size
>>>>>> image that has transparency. Better to work with smaller HUD images 
>>>>>> instead.
>>>>>>
>>>>>>
>>>>>> Greetings,
>>>>>>
>>>>>> On Wed, Sep 17, 2008 at 6:33 AM, Jim Sager <[EMAIL PROTECTED]> wrote:
>>>>>>
>>>>>>> I copy/pasted the code from Walktest to show pixmaps. If I draw on the
>>>>>>> entire screen every frame, it slows things down horribly.
>>>>>>>
>>>>>>> If you want an example, try:
>>>>>>> http://rapidshare.com/files/145329460/xyzim.zip.html
>>>>>>>
>>>>>>> Hit f6 a few times and as the windows pop up, the Frames Per Second drop
>>>>>>> sharply.
>>>>>>>
>>>>>>> I want to use a HUD, but I don't want to lose noticeable amounts of 
>>>>>>> Frames
>>>>>>> Per Second.
>>>>>>>
>>>>>>> I also have a mainly 2d program that I have on the back burner.  I'd 
>>>>>>> really
>>>>>>> like to use CRYSTALSPACE with it because I am familiar with the library.
>>>>>>>
>>>>>>> Thank you for reading,
>>>>>>> Jim
>>>>>>>
>>>>>>> -------------------------------------------------------------------------
>>>>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's 
>>>>>>> challenge
>>>>>>> Build the coolest Linux based applications with Moblin SDK & win great
>>>>>>> prizes
>>>>>>> Grand prize is a trip for two to an Open Source event anywhere in the 
>>>>>>> world
>>>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>>>>> _______________________________________________
>>>>>>> Crystal-main mailing list
>>>>>>> [email protected]
>>>>>>> https://lists.sourceforge.net/lists/listinfo/crystal-main
>>>>>>> Unsubscribe:
>>>>>>> mailto:[EMAIL PROTECTED]
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> Project Manager of Crystal Space (http://www.crystalspace3d.org)
>>>>>> and CEL (http://cel.crystalspace3d.org)
>>>>>> Support Crystal Space. Donate at
>>>>>> https://sourceforge.net/donate/index.php?group_id=649
>>>>>> Visit my town at http://waldir.myminicity.com/
>>>>>>
>>>>>> -------------------------------------------------------------------------
>>>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's 
>>>>>> challenge
>>>>>> Build the coolest Linux based applications with Moblin SDK & win great 
>>>>>> prizes
>>>>>> Grand prize is a trip for two to an Open Source event anywhere in the 
>>>>>> world
>>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>>>> _______________________________________________
>>>>>> Crystal-main mailing list
>>>>>> [email protected]
>>>>>> https://lists.sourceforge.net/lists/listinfo/crystal-main
>>>>>> Unsubscribe: mailto:[EMAIL PROTECTED]
>>>>>>
>>>>>>
>>>>> -------------------------------------------------------------------------
>>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's 
>>>>> challenge
>>>>> Build the coolest Linux based applications with Moblin SDK & win great 
>>>>> prizes
>>>>> Grand prize is a trip for two to an Open Source event anywhere in the 
>>>>> world
>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>>> _______________________________________________
>>>>> Crystal-main mailing list
>>>>> [email protected]
>>>>> https://lists.sourceforge.net/lists/listinfo/crystal-main
>>>>> Unsubscribe: mailto:[EMAIL PROTECTED]
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> Project Manager of Crystal Space (http://www.crystalspace3d.org)
>>>> and CEL (http://cel.crystalspace3d.org)
>>>> Support Crystal Space. Donate at
>>>> https://sourceforge.net/donate/index.php?group_id=649
>>>> Visit my town at http://waldir.myminicity.com/
>>>>
>>>> -------------------------------------------------------------------------
>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's 
>>>> challenge
>>>> Build the coolest Linux based applications with Moblin SDK & win great 
>>>> prizes
>>>> Grand prize is a trip for two to an Open Source event anywhere in the world
>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>> _______________________________________________
>>>> Crystal-main mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/crystal-main
>>>> Unsubscribe: mailto:[EMAIL PROTECTED]
>>>>
>>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great 
>>> prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> Crystal-main mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/crystal-main
>>> Unsubscribe: mailto:[EMAIL PROTECTED]
>>>
>>>
>>
>>
>>
>>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Crystal-main mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/crystal-main
> Unsubscribe: mailto:[EMAIL PROTECTED]
>



-- 
Project Manager of Crystal Space (http://www.crystalspace3d.org)
and CEL (http://cel.crystalspace3d.org)
Support Crystal Space. Donate at
https://sourceforge.net/donate/index.php?group_id=649
Visit my town at http://waldir.myminicity.com/

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]

Reply via email to