Skinning contest: One month to go (5 Viewers)

offbyone

Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    In WPF when you create any Element declarative in XAML and give it a Name attribute, you can access that element using that name in the code behind.
    FindResource will do a lookup in the elements defined inside the Resource tags.
     

    Baboonanza

    Retired Team Member
  • Premium Supporter
  • February 5, 2010
    143
    57
    North London
    Home Country
    United Kingdom United Kingdom
    Re: AW: Skinning contest: One month to go

    Oh that is sad...
    Can you give me a hint how to realize this? Because the ellipses have different blur effects.

    I attached the source of my WPF application, but the source is very ugly, so you are warned^^
    Well, clearly I'm wrong. It does work like that :) They must be doing something clever behind the scenes.

    I can see the problem with implementing that sort of effect without code. You could do it, but it would be quite cumbersome and lose randomness. I still think the best solution would be adding a particle effect to the SkinEngine, otherwise everyone is going to have to roll their own solution and ship plugins with their skins. It would also be much more efficient from a rendering perspective.

    The root of the problem is that when you create a WPF application you have control over both the code and the XAML. When skinning MP2 you only control the XAML, so some things are going to be more difficult to accomplish.
     

    FreakyJ

    Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    AW: Skinning contest: One month to go

    You are right^^ A basic support in the skinEngine would be the best, maybe some of you can help and give me some input me when I'm back on Monday :)
    I also want to improve the performance of the particle effect, because at the moment it uses a lot of CPU power (5%), but I have already an idea :p
    To make an inMemory PNG from the ellipse and move the image...

    But If somebody has an idea or want to implement it in MP, don't be afraid^^
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Shouldn't particle systems be possible to be implented with pixel shaders? At least to some extend. In that case we could just allow skins to provide different pixel shader code to be used as an effect.

    In any case we should split this thread to few topics at least... starting to get confusing and most likely not helping to learn the skinning process at all :)
     

    Baboonanza

    Retired Team Member
  • Premium Supporter
  • February 5, 2010
    143
    57
    North London
    Home Country
    United Kingdom United Kingdom
    Re: AW: Skinning contest: One month to go

    Are you talking about something like that?:
    Particle Effects in WPF - CodeProject

    So this was my last post for now^^ But I promise, I will dig deeper into this topic :p
    The advantage we have is that implementing it in the SkinEngine means we can optimise it to work with well with DirectX. Usually you'd pack all the particles into a single vertex buffer and render them all in one draw call. There are then serveral different ways to modify/update their individual positions, such as using an algorithm in the vertex shader or just updating the whole buffer every frame.

    In contrast what you (and the example) are doing in WPF requires lots of extra code to be executed, since the underlying framework is treating every ellipse as an independent object. Combined with all the extra GPU state changes required it's really inefficient. There are comments from people in that example who are complaining that the particle system is using 75%+ of a dual core CPU. We can do much better than that :)

    That example is very useful as a guide to the interface we should have though.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Yeah. Particle Effects are gonna be real useful in MP :rolleyes:

    Pixel shaders could be used for almost anything. Not just particle effects. Blur, grayscale, water like animation... list is endless
     

    Albert

    MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    46
    Freiburg im Breisgau, Germany
    Home Country
    Germany Germany
    AW: Skinning contest: One month to go

    Oh that is sad...
    Can you give me a hint how to realize this? Because the ellipses have different blur effects.

    I attached the source of my WPF application, but the source is very ugly, so you are warned^^

    Finally I had the time to try your WPF application.

    Well, I would say the problem that you don't have access to the MPF elements from code is not such a problem. I would create 10 or 20 or so particles on the canvas and bind it to position vectors which come from a model. Those position vectors must be changed by the movement algorithm.

    I cannot tell you how you can create the particles; Baboonanza is a much better source for that question.
     

    Users who are viewing this thread

    Top Bottom