solid pixels covered by entity?

Posted By: HeelX

solid pixels covered by entity? - 04/30/06 13:03

Hey,
I just want to ask wether this is possible or not.

Imagine your screensize is 800x600 pixels and you've got a bitmap allocated that fits the same resolution (800x600) and you've got a cube, a sphere or whatever as model visible on the screen, in case A covered with nothing B covered partially by another entity and C intersected by another entity.

In one or all three cases, would it be possible to draw on this bitmap, filled entirely black, each pixel white, which corresponds to a pixel covered by the entity??

Here are example pictures to demonstrate what I'm talking about:



mfG
Christian Behrenberg
Posted By: Alexander Esslinger

Re: solid pixels covered by entity? - 04/30/06 13:36

Sure, that's possible (with pro) - it doubles your rendering times though.

EDIT: Oh.. and render-targets in a6 needs to be a power of 2 in size..
Posted By: HeelX

Re: solid pixels covered by entity? - 04/30/06 13:59

I dont want to re-render the scene, I just want to know if one pixel is covered by an entity.. something like

pixel_for_entity(you,12,36);

Is true or false if the pixel x=12 y=36 is covered by the you entity.
Posted By: Alexander Esslinger

Re: solid pixels covered by entity? - 04/30/06 14:13

I'm not sure what you want: In your first post you want to render the object on your bitmap white (render-to-texture), now you want a function? Those two approaches are quite different..
Posted By: HeelX

Re: solid pixels covered by entity? - 04/30/06 14:18

well, what would be faster? rendering a second view with mutiple objects on screen whose solid pixels write a white pixel or going through a loop for each pixel and then through the entity list to check some entities to draw a pixel?

I could use the function method to increase drawing my pixels because I could focus only on a constrained part of the screen (I would take the boundingbox coordinates to determine the area which I would check). Otherwise, when I have a lot entities on the screen who should draw white pixels, I would take the second view method.

So... two considerations, what would be faster and how would I do that?
Posted By: mk_1

Re: solid pixels covered by entity? - 04/30/06 15:49

Ich nehme mal an, es geht hier wieder um ein 2.5D Spiel a la Resident Evil...Ich denke, da gibt es einfachere Möglichkeiten. Du könntest Modelle benutzen, die dein Hintergrundbild zeichnen, ohne Abstriche. Das wäre alles, was du brauchst.

Sorry, wenn dein Spiel in eine andere Richtung geht.
Posted By: HeelX

Re: solid pixels covered by entity? - 05/01/06 00:56

Nein, das hat nichts mit dem Arbeitstitel zu tun, an dem ich beteiligt bin, eher einer Idee die ich hatte, als ich folgendes Video gesehen habe:

http://www.youtube.com/watch?v=Lutlj0MlJpo&feature=Views&page=1&t=a&f=b

Ich hatte die Idee für eine Szene, wo sich halt ein 3D Objekt bewegt, dass keine uniforme Hülle hat, sagen wir mal eine Schusswaffe, die sich dreht oder irgendwas.. naja, verändert in Form, Skalierung und Rotation. Dann ändert sich auch die Außenhülle ständig, wenn man das Objekt auf eine 2D Ebene projiziert (der Screen) und die Kanten nachzeichnen würde. Das als Kollisionshülle für ein Männchen, was drauf rum läuft, springt, mit Gegner in einem flüssig bewegten Design mit hin und her shiftenden Objekte wär mal was total abgefahrenes! Und dann hab ich mir überlegt was man da fürn Ansatz nehmen könnte.

mfG
Christian
Posted By: Matt_Aufderheide

Re: solid pixels covered by entity? - 05/01/06 05:15

The best way to do it would be if you had access to the draw order, then you could draw the cube last and just render it to a target the same size as your backbuffer, and use the same zbuffer, with zenable=on and just clear everything on your new target to black.

So bascially to do it currently, you will need a simple dll, that uses a render event triggered by render_entities .. then just do the steps i mentioned.
© 2024 lite-C Forums