If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Changing the color of objects/primitives only ? (flat shading...) (massive parallel lookup hardware idea...)
(See below for "massive parallel lookup hardware idea, inspired by the old
vga cards") (The idea is: instead of writing lookups to the graphics card/video memory/monitor... the lookups become available to the cpu/applications). There might be a way to do what I want with performance benefits all over... OpenGL has the ability to seperate vertex, normals, color, texture coordinates information into individual arrays. glColorPointer could be used to specify a color/rgba array (for rgba mode) glIndexPointer could be used to specify a color/index array (for palette mode) The nice thing could be that this was part of opengl 1.0 or opengl 1.1... I am not sure if windows 95 came with opengl 1.0 or opengl 1.1 The dll is called opengl32.dll at least on my system... Microsoft seems to provide opengl95.exe as well... I am not sure what that is ? it does say 1.1 is it an update to 1.0 ? I am not sure... Delphi's old opengl unit does seem to have these two methods which officially seem to be slight extensions... so even 1.0 or 1.1 had these extensions already in place... delphi has a strange way of including these: The function name seems to be: PFNGLCOLORPOINTEREXTPROC Which is really weird looking apperently at the time glColorPointer might not have been standardized yet ?!? The unit seems to be from 1991-1993 at least the copyright notice shows... so seems plausible... The oldest date I have seen so far is 1981... kinda funny that opengl is already so old ! My windows 95 computer is now shutdown... so I can't try this function out yet... but my bet is it is supported. This would be great since then I can "upload" all of my vertices just once... and only have to re-upload the color as it changes... and then I can do some further optimization tricks. To-be-continued/investigated Also I am curious if index-mode might work faster on a software rendering... from what I remember from the dos days writing to a memory plane was about setting the color index if I remember correctly... the palette would also be set in hardware.. The hardware takes care of looking up the color indexes and turning them into actual colors... so at the time... no cpu lookups had to be done. Quite amazing really since nowadays lookups are a pain/slow... ofcourse they not really lookups... they are more "writeups"... nothing is returned to the user/application... instead the lookups are written to the graphics cards/monitor... so it's more like a "look and write up" I wonder if special hardware could be made for massive ammounts of lookups... since cpu/memory don't work so well for it... Maybe some kind of massive-parallel lookup hardware, it will surely be usefull for something ?! Bye, Skybuck =D |
#2
|
|||
|
|||
Changing the color of objects/primitives only ? (flat shading...) (massive parallel lookup hardware idea...)
Indeed, this page explains it further:
http://opengl.org.ru/docs/pg/0206.html OpenGL 1.0 had no vertex arrays though some implementations implemented it as an extension. OpenGL 1.1 does have vertex arrays. Now the big question is what version came with Windows 95 ? Unfortunately opengl itself has no "version" information ? The version string itself is for the renderer/vendor and seems unrelated to what the actual supported opengl implementation is ?!? Ultimately it might not matter... even if windows 95 comes with opengl 1.0 maybe it also have the extension ?! Time will tell. At least Delphi had it... so that's a good sign Bye, Skybuck. |
#3
|
|||
|
|||
Changing the color of objects/primitives only ? (flat shading...) (Re-using verteces, is user supplied data considered "state" as well ?)
It's is often said that opengl is a big state machine.
The question is does this extend/apply to user provided data as well, like verteces for example ?!? If so then in theorie the following should work: // rendering loop: while true do begin glClear; // perhaps... clear could be skipped as well. if mFirst then begin // supply vertex data to opengl state machine only on first frame glVertexPointer end; // supply color information for each frame. glColorPointer // draw vertex array. // flush. end; So far the theory... The question is... will this work in practice ?!? Or will it not work and will opengl become confused ?!? Is the call to glVertexPointer necessary for each frame (static data) ? hmmm. Time will tell, since sometime it will make an example or implementation of these idea's I suspect it won't work... but it would be great if it did I give it a 50% of working and 50% of not working. Bye, Skybuck |
#4
|
|||
|
|||
Changing the color of objects/primitives only ? (flatshading...) (Re-using verteces, is user supplied data considered "state" aswell ?)
Am Thu, 29 Jul 2010 11:47:59 +0200
schrieb "Skybuck Flying" : It's is often said that opengl is a big state machine. Yes. It's been defined that way. The question is does this extend/apply to user provided data as well, like verteces for example ?!? If those vertices are stored in an OpenGL object (Display List, Vertex Buffer Object), then yes. // rendering loop: while true do begin glClear; // perhaps... clear could be skipped as well. Why could you skip it? There's still the content of the previous frame here. if mFirst then begin // supply vertex data to opengl state machine only on first frame glVertexPointer end; Not the vertex data is supplied here, but the information, where the vertex data can be found. I think the function suffix -Pointer should make this pretty clear. // supply color information for each frame. glColorPointer // draw vertex array. // flush. end; So far the theory... The question is... will this work in practice ?!? Not this way. Well, you can of course use vertex arrays, and adjust the data in the color pointer array continously. Since gl{Color,Vertex,Normal,Attrib}Pointer don't upload you can do this even on the fly, while the pointer is set. If you want to upload stuff to the GPU use Vertex Buffer Objects. To replace a portion of the VBO you can use glBufferSubData just like you'd to with glTexSubImage. Or will it not work and will opengl become confused ?!? The only one confused here, is you. Is the call to glVertexPointer necessary for each frame (static data) ? hmmm. gl{Vertex,Color,Normal,Attrib}Pointer isn't uploading stuff. It doesn't work like glTexImage. It's just setting a variable in OpenGL to where to find the vertex data when instanciated by glDrawElements/glDrawArrays. In the case VBOs are used instead of a pointer into process memory it sets an offset in the buffer data. There's example code at the end of http://www.opengl.org/registry/specs...fer_object.txt Time will tell, since sometime it will make an example or implementation of these idea's For god's sake: Just read the documentation. It's all written down there in very clear form. It's not archeology or historic research, where you've to develop theories. Everything has been exactly specified. Wolfgang -- CIP-Rechnerbetriebsgruppe Fakultät für Physik - LMU München Schellingstrasse 4, 80799 München |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Parallel huffman encoding and decoding algorithm/idea by Skybuck for sale ! | Skybuck Flying[_2_] | Nvidia Videocards | 13 | September 28th 09 11:54 PM |
Which hardware architecture was better DX9 or DX10/DX11 for pure speed ?! (massive parallel execution) | Skybuck Flying[_2_] | Nvidia Videocards | 2 | September 28th 09 08:59 AM |
Touching a flat panel monitor: REALLY bad idea? | [email protected] | Dell Computers | 19 | December 4th 05 10:14 PM |
changing flat cable on printer cartridge? | [email protected] | Printers | 3 | October 7th 05 05:17 AM |
AT7 massive "Hardware Failure" messages in windows XP | Marcus Hilderbrand | Abit Motherboards | 4 | January 28th 04 11:14 PM |