Shaders

Introduce your project and write about your work.

Moderator: PPS-Leaders

Post Reply
The Jo
General DuGalle
Posts: 121
Joined: Mon Mar 01, 2010 7:43 pm

Shaders

Post by The Jo » Thu Nov 22, 2012 9:24 pm

I'm posting the latest discussion with David who is working on the "Shaders" Ticket.
Habe dabei auch gemerkt, dass setDimensions (bei vergrössern) von Billboard dazu führt, dass das RenderSystem nicht mehr mit der richtigen BoundingBox für das Billboard arbeitet und somit das Billboard schon viel zu früh vom Frustum-Culling abgeschnitten wird. Ich bin mir noch nicht sicher ob das an der Implementation von Billboard/BillboardSet in orxonox liegt oder ob es ein Bug in Ogre ist. Auf jeden Fall hab ich jetzt Mal eine Funktion hinzugefügt, dass man das Culling für das entsprechende Billboard abschalten kann. Irgendwann müsste man sich aber wohl überlegen ob man die BoundingBox bei entsprechendem Aufruf von setDimensions neu berechnen sollte oder ob das ein zu grosser Performancehit ist wenn man es generell macht.

Mir scheint die Implementation von Billboard und Billboardset aber generell etwas Wonky, vielleicht sollte man sich Mal überlegen die beiden Klassen neu zu schreiben, damit es mehr wie Ogre::BillboardSet und Ogre::Billboard operiert. In der momentanen Implementation hat jedes Billboard sein eigenes Set, was in vielen Fällen gar kein Sinn macht und somit auch BillboardSet zweckentfremdet.
Fail. Fail again. Fail better.

User avatar
x3n
Baron Vladimir Harkonnen
Posts: 810
Joined: Mon Oct 30, 2006 5:40 pm
Contact:

Re: Shaders

Post by x3n » Wed Nov 28, 2012 2:01 pm

That's a good point. There's definitely space for a lot of improvements in our code. The problem is that someone has to dig into Ogre's documentation and figure out what's the best practice to use it. The same applies also to the embedment of physics and sound into our framework.

Regarding the BillboardSet:
I'm not sure if it is really bad to use them like we do it now (i.e. one set per billboard). Having multiple billboard sets with one billboard in it is not necessarily slower than a single set with many billboards. It depends on Ogre's implementation and how we use it in the game. It's possible that Ogre always updates all billboards in a set, even if only a small part of it is visible. With multiple sets, Ogre would only update those that are visible. I'm not sure about this however.
By the way, we have ParticleEmitter for particle effects, which is just a wrapped billboard set if I'm not mistaken. So technically this a way to put multiple billboards into a single set in Orxonox.
But of course I can imagine cases where it mighty be handy to put multiple billboards into the same set; when we attach lots of billboards to a single spaceship, for example.

I see David is working a lot on graphics. That's awesome and he's welcome to suggest (or even better: implement) some improvements to our framework :)
Fabian 'x3n' Landau, Orxonox developer

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests