Archived

This topic is now archived and is closed to further replies.

MindFlayer

How to draw a single pixel in dx8?

Recommended Posts

Ok... the title tells most of this. I have got my 3D-stuff working. I can see nice polygons with lighting etc... but I still don''t know how to draw a single pixel in dx8! Any ideas?? Thanks! Press any key to continue or any other key to quit...

Share this post


Link to post
Share on other sites
Lol, drawing pixels separately is slow. I draw slpashscreen using D3DPT_POINTLIST. But there''s not extreme speed required, since it''s blitted just once.

Share this post


Link to post
Share on other sites
Cant you just mess with the buffer data directly? Why in the name of god wouldnt they have some simple ReadPixel() and WritePixel() functions??

Share this post


Link to post
Share on other sites
quote:
Original post by MindFlayer
Thanks! That one helped me a bit, but isn''t it quite slow to draw pixels by this way? (I need to draw them a lot!)

G''day!

Yes it is slow, but ReadPixel() and WritePixel() (as someone else lamented the lack of) are orders of magnitude slower.

Locking the buffer stalls the rendering pipe, stalls are very bad. Using a point-list will get you (some) hardware acceleration. Most cards probably render points as 1-pixel triangles, so you can see how they wouldn''t be blindingly fast. There really isn''t much demand for it though.

If you batch up your list of points to be drawn each frame it probably won''t be too bad. It al depends how many points you''re drawing.


Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
The question I always ask here is:

What are you trying to do?

One person who asked this question was drawing curves, using 2000 points to get continuity, instead of using a line strip with 10-100 points.

Drawing a splash screen strikes me as something that could be done with a texture.

So - what exactly are you doing? Perhaps there is a much easier way...

Share this post


Link to post
Share on other sites
I'm doing the famous plasma-effect which needs all pixels on the screen to be refreshed. This is naturally horribly slow so I might need to go on to lower resolution... I could also switch back to DX7 (=easy direct surface write) but I don't want to do that . Isn't there any better ways?

Edited by - MindFlayer on July 30, 2001 11:22:17 AM

Share this post


Link to post
Share on other sites
quote:
Original post by CrazedGenius
Can you create the same effect using the fire example in nVidia''s effectsbrowser?


Umm... I have never heard about what you''re talking!

Share this post


Link to post
Share on other sites
There are a few resources that you should be aware of.
http://partners.nvidia.com/developer.nsf
is one of them...

It strikes me that there may be a (new?) way to do plasma using textures and shaders. If you can work it out, you might be able to do it really efficiently.

Share this post


Link to post
Share on other sites