Author |
Message |
Caleb
Rating: N/A Votes: 0 (Vote!) | Posted on Tuesday, April 09, 2002 - 4:42 pm: | |
I am looking for a "how to" on rendering stereo image pairs using nvidia cards (not 3D stereo!). I am basicly trying to figure out how nVidia got their stereo viewer to work. I have scratched around in the binary and it seems they are using directX. What I can't figure out is the magic parameters needed to switch the stereo glasses on and get the video card to render the memory contents... any ideas? |
David C. Qualman
Rating: N/A Votes: 0 (Vote!) | Posted on Tuesday, April 09, 2002 - 6:00 pm: | |
Contact tech support at nVidia directly. They will be the best source of information. |
Caleb
Rating: N/A Votes: 0 (Vote!) | Posted on Tuesday, April 09, 2002 - 11:19 pm: | |
Do you have an email address for me, mail it to me if you don't want to post it. I've emailed messages to info@ and few others that I found in technical documents asking them to refer me to the correct person to email. I have yet to recieve a responce. |
Richard G.
Rating: N/A Votes: 0 (Vote!) | Posted on Tuesday, April 16, 2002 - 2:27 am: | |
I'm looking for the exact same information. I've done a small amount of debugging with SoftICE and a few other tools but I haven't cracked it yet. It appears that they are using DirectDraw *AND* Direct3D. DirectDraw 7 has built-in capabilities for handling stereo page flipping but the stupid Nvidia driver apparently doesn't support it (I've written a lot of code which verifies this). I sent an email to 'DeveloperRelations@nvidia.com' last thursday, requesting contact info with one of their engineers.. We'll wait and see if they hook me up or not.. |
David C. Qualman
Rating: N/A Votes: 0 (Vote!) | Posted on Tuesday, April 16, 2002 - 6:28 pm: | |
Rule of thumb: Don't ever try to use stereoscopic support that allegedly was built into DirectX. The only ones that appear to have ever supported it was Rendition, back with DirectX 3. With DX5, DX6, and DX7, nobody (that I ever saw) used the DirectX documented methods for stereoscopy. With DX8, Microsoft finally states that stereoscopy support is not included. The result is that all stereoscopic methods under DirectX are "behind the scenes" soulution. BTW: I am assuming that the above methods to hack and crack nVidia's solution are in violation of their agreement for you to use the drivers. Even if nVidia is unwilling to make their solution available, we must not stoop to the level of criminals, rogues, and pirates to advance our interests. |
Anonymous
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, April 17, 2002 - 12:21 am: | |
Its not immoral to do that, and it may not be illegal. Reverse engineering in general is not illegal, its a gray area. IANAL but as I recall reading you can legally reverse engineer for the purpose of making systems interoperable, and this sounds like he wants to make his software interoperable with nvidias stereo driver and that is the only means they can do that. Sega or Atari I believe won a lawsuit against them by Nintendo, because they had reversed engineered one of Nintendos chips for the specific purpose of making games on the nintendo entertainment system with out the need for Nintendo to step in. Again IANAL (I Am Not a Lawyer), if it really concerns you, you should contact a lawyer and/or do more research. The DMCA law makes things a little more difficult especially in the gray areas of 'encryption' and 'encoding'. I've heard some people make the arguement that machine code is like 'encryption' and there for protected by the DMCA from reverse engineering, but any one who understands machine code should know that is just BS. Imagine if you bought an educational/instruction book for your child so he could learn to do things but were told its illegal for you to read the book yourself. Again reverse engineering is not immoral... |
Richard G.
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, April 17, 2002 - 1:08 am: | |
Good news - an engineer from NVidia has contacted me and I sent him my question.. Hopefully we'll have an answer to this within the next few days. This may save me the work of reverse engineering their stereo viewer. As far as immoral/illegal, this is what I have to say: If anyone doesn't want me using my God-given powers of reasoning to understand the inner workings of a hardware or software product, they can bite me. Hell you might as well make it illegal to think for yourself - the information is *ALL THERE* in the executable code. You just gotta be smart enough to pull it out. If some company wants to enforce security through obscurity and gets mad at me because I'm more intelligent and motivated than most of the lusers that they pander to, then they deserve the fight. Besides, it seems pretty obvious to me that having cool free 3D software that uses the stereo glasses will do the company much more good than harm. Richard |
David C. Qualman
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, April 17, 2002 - 6:39 am: | |
These arguments are valid. All three of us recognize that we are not lawyers, so do not have an exact ruling on whether it is illegal, much less immoral, to reverse engineer a driver. But we cannot forget that the video card vendors basically are loath to the stereo community. They are unwilling to add a ten cent 3 pin mini din for the glasses (I was in the VESA committe and listened to the video card guys explain exactly that). None are willing to add native stereo support to their drivers per the DirectX spec. All but a couple disregard stereo altogether. A serious detriment to our community occured a few years back when a stereo company posted confidential source code from a video card vendor onto the web. As a result, this video card vendor would never support stereo again, unless you gave them millions of dollars. My point is that if we want respect as a community, we need to play by the big guys rules. They have the tools we want. They can also not share them. In other words, contact nVidia directly, and get the support from them. Don't make them suspicious of us by posting to the world that we are a community of hackers and crackers. BTW - black box reverse engineering is not the same as "read the machine code" reverse engineering. With black box engineering, you send a known input into an understood system, and analyze the output. With this type of engineering (the Sega example, I believe), you just need to build a system that creates the same outputs from the inputs. This has several times been upheld in the courts. But, reading the machine code is akin to taking trade secrets. Remember, your rights to use the drivers is strictly limited by the license agreement. I hope none of us are suggesting that we should lie when we agree to the license. Even with your God-given powers, you either made an agreement and will stick by it, or you are lying to them when you accept the agreement. |
M.H.
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, April 17, 2002 - 7:30 am: | |
Solution for all: Forget the DirectX stereo standard. Use the OpenGl stereo standard as implemented on Oxygen, Wildcat, Fire Gl, and all GeForces hacked to Quadro (or buy a tru Quadro). It works stable, it is fully HW acclerated, support both in window/full screen stereo. Code is Linux/Unix/Irix portable as an addition. By the help of SciTech GlDirect library this stereo mode is supported on almost all graphic cards and OS in adition ... I am just in addition experimenting with OpenGl/Winx3D library wrapers witch can make this solution even much more universal .... |
Anonymous
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, April 17, 2002 - 7:21 pm: | |
First it was the Elsa DirectX stereo driver, was it DX6? Now we have nvidias new driver for DX8. Well DX9 is about to appear and maybe some new or different kind of stereo driver? And then there is DirectX10, 11... It will probably change a lot in he near future so wasting time on a temporary "standard" sounds like a bad idea. OpenGL stereo has been around for a long time and will stay alive for a long time too, so that sounds more intresting. Anyone in contact with nvidia about stereo support, ask for opengl stereo in the geforce driver too, not just the quadro. |
Richard G
Rating: N/A Votes: 0 (Vote!) | Posted on Thursday, April 18, 2002 - 2:46 pm: | |
I won't get into the OpenGL/DirectX debate, but simply say that I have good reason for wanting to use DirectX - it will work on any GeForce card without the Quadro driver hack. I still haven't heard back from the Nvidia Application Engineer (I'm keeping my fingers crossed for today) but I do have more information. I did a little bit more debugging last night and found some more information. Yesterday I re-installed the DirectX 8.1 SDK and installed the DEBUG run-time code. I once again ran the nvstview.exe program with Dependency Walker and came up with a good deal of debug output. Most of it didn't make too much sense but I did discover several things. 1) In DirectX 8, DirectDraw has been integrated with Direct3D. As a result, I believe that the stereo viewer program never actually creates a DirectDraw object - it only creates a Direct3D8 object, which manages the DirectDraw object internally. The documentation for the Direct3D8 interfaces is available with the Dx8.1 SDK, which is a 150Meg download from microsoft.com. 2) The Direct3D8 object handles stereo flipping totally differently from DX7 and older.. In D3D8, the stereo flipping chain (with all the buffers) is created automagically when the D3D8 object is created. D3D8 has its own enumerated types and preprocessor definitions to support stereo flipping chains. However, the microsoft documentation says that the D3D8 stereo flipping chains are not supported.. So MS created a new interface for this capability, then said that it doesn't work. Go figure. 3) The nvstview.exe program uses 1280x1024 full-screen mode, and it creates four buffers when it creates the D3D8 object - presumably these are front and back buffers for each channel (left and right). It does 4 hardware blits right before going into stereo mode - I'm assuming that it pastes the left image onto the front and back buffers for the left channel, and the right image onto the two buffers for the right channel. It uses Stretch blits - because the input image I was using for testing was 830x541, but it filled the entire width of the 1280x1024 screen. 4) The call from nvstview.exe to create the D3D8 object generates a debug message from DirectX, because it has a flag set to use non-local Texture memory, but _NOT_ non-local Video memory. I don't know if this has anything to do with forcing the driver into stereo mode or if it was just an oversight on Nvidias part. So we're a little closer to understanding what's going on with this. My next step will be to set a breakpoint with SoftICE in Direct3D and trap the call to create the D3D8 object, then examine the parameters passed into this function. If I don't hear back from the Nvidia engineer before this weekend then I may continure my debugging then. Richard |
Anonymous
Rating: N/A Votes: 0 (Vote!) | Posted on Friday, April 19, 2002 - 5:07 am: | |
I recall that its more to do with system interoperability then it is to do how they reverse engineered it (black box or not). They didnt go after the creators of DeCSS because they reversed engineered a DVD player... then again that would not have prevented the distribution of DeCSS, and there intention was to make sure no one knew how to decode DVDs with out a licensed player, so going after them for reverse engineering was unimportant. There is also limitations to licenses, like someone can not put on their license that you are their love slave for all eternity. And I believe that people under a certain age, can not agree to any license, so license agreements do not apply to them. Usually these things are diffrent from country to countr, state to state. If any one was serious about doing it, they again should check with a real lawyer, the lawyer will tell you in less vague terms of what you can and can not do in your state/country legally. As for the triffle matter of stereo drivers, I think its just lame, I have not seen a serious solution to the stereoscopic 3d problem, most of them are what I would lable as proprietary solutions, they only cover a niche market (certain video cards or certain shutter glasses, etc), therefore there is no real standard that fits many configurations, and each one has their own way of handling stereoscopic 3d, making the problem worse. For example I am using Nvidias stereo driver at home, and Scitechs GLDirect at work, and they both work diffrently and have diffrent interfaces to change your settings. To me, they are just not serious about it... its just a joke to them. I would almost prefer no stereo drivers, to broken/incompatible/non-standard implementations. What I dont get is why hasnt microsoft just have a feature where you can force stereo even if the game doesnt actively use it, that is user level stereo instead of programmer level stereo. Then again microsoft has done a lot of screwy/anoying things with Direct3D that I dont like but I am forced to use at my work. If I was to do it in DirectX 8 fullscreen, I would just try turning on vsync with double buffering at a high frequency, and use that to control left and right images, and if they hit a hot key, reverse the left and right images. Interleaved would be easy and would cover hardware line blanking, and doubling would be easy as well and support sync doubling, and I already mentioned page flipping by turning on vsync. All I would need is just something like libjpeg to load the images and place them in surfaces. Then see if it works... Why use any type of proprietary junk like Nvidias drivers, which only people with Nvidia video cards will be able to use it, and on top of that some people who have problems with Nvidias drivers will be unable to use it. |
Richard G.
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, April 22, 2002 - 10:56 pm: | |
Sorry guys, bad news.. The 'engineer' at nVidia won't help me, because nVidia wants us to buy Quadros in order to get stereo image display capability... So it looks like I'll be continuing my investigation into the internal workings of DirectX in order to get an answer to this issue.. I'll post here if I ever get anything to work but it could be a long time. Richard |
David C. Qualman
Rating: N/A Votes: 0 (Vote!) | Posted on Tuesday, April 23, 2002 - 12:48 am: | |
Richard, I would like to send some assistance to you on dealing with nVidia, but the email address that you post is ineffective. Perhaps you could hold out your hand for help. |
M.H.
Rating: N/A Votes: 0 (Vote!) | Posted on Tuesday, April 23, 2002 - 9:03 am: | |
Richard G: Just a glue :-). It is possible to use nVida DirectX stereoscopic support for evrything (means still image visualisation, stereo-video rendering) without any knowlidge about this proprietary standard. The method is fully legal. Judst thing a bit in 3D and maybe you will get it :-). |
Anonymous
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, April 24, 2002 - 3:52 pm: | |
Maybe we are too dumb to "get it" so why don't you tell us instead. |
Anonymous
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, April 24, 2002 - 6:24 pm: | |
He might be refering to using Direct*3D*... |
Richard G.
Rating: N/A Votes: 0 (Vote!) | Posted on Thursday, April 25, 2002 - 10:54 pm: | |
Hello all, If you wish to contact me you may do so through the email address above this post - it's spam protected though so you'll have to modify it first. David, I would very much appreciate it if you could help me out w/ dealing with nVidia.. M.H. - I'm not sure that I see what you're hinting at. I can tell that Direct3D is required because the nVidia stereo image viewer uses it.. It remains unclear to me though how I may use the obvious nVidia DirectX support to display stereo images.. I mean I could use an image as a texture and paste in on a poly in front of the viewer, but that would be just like when the bad guys get sentenced to the 2nd dimension in Superman - the image plane will be in 3-space but the image on the plane is still two dimensional.. Are you aware of any Direct3D functionality which allows for true stereo image display? Thanks, Richard |
M.H.
Rating: N/A Votes: 0 (Vote!) | Posted on Friday, April 26, 2002 - 9:14 am: | |
Richard: I was trying to send you more information, but yor E-mail does not work. Anonymous: The used technolgy is a part of a comercial project, I can give a glue but not the source code. Or maybe I am just dumb and I do not know what I am saying. |
Richard Scullion
Rating: N/A Votes: 0 (Vote!) | Posted on Friday, April 26, 2002 - 12:48 pm: | |
Hi, For those who don't know me I'm the author of 3DCombine and also would be very interested in getting 3D support working with the latest NVidia drivers. In the interests of information sharing I'll explain the hack that I used to display pictures and video with the old ELSA 3D drivers and maybe that'll give people some ideas. Basically I exploited a bug in the ELSA drivers whereby text and graphics was only being drawn onto one eye. The problem was that when a DirectDraw surface was blitted to, the ELSA drivers grabbed the image and drew it to the left and right buffers. However, if the image was drawn using pixel commands or blitted using the GDI, the ELSA drivers didn't pick it up and so the image was only drawn onto the left buffer. The obvious way to use this was to blit the right image onto both buffers by using DirectDraw and then blit the left image onto the left buffer only by using the GDI. This worked a treat. It also helped that the later ELSA drivers were much more willing to activate the glasses than the current NVidia ones. The current version of 3DCombine uses a similar method in its pageflipping mode but the glasses don't activate, it's very unreliable, and it doesn't work with videos. I agree that it's a shame that such an excellent standard as OpenGL Quadbuffered stereo is being held back by NVidia's business interests but all we can do is try and work with what we've got. Hopefully some other company like ATI will add quadbuffered support to their cards and remove the monopoly. MH: I'd be very interested in what you have to say as well. Richard |
Richard G.
Rating: N/A Votes: 0 (Vote!) | Posted on Friday, April 26, 2002 - 2:23 pm: | |
M.H. - Sorry that you couldn't get the email to work.. I hate to send in clear text but here goes: 3DShite@fascinationsoftware.com. I own the domain so the first part doesnt matter - it all goes to me. I thought more about what you said and I think I understand now where you're going with the hints but the solution still isnt perfect.. Anyway, here's the idea: the D3D drivers do the 3D effect by offsetting the camera location.. ie, instead of rendring a single frame from (0,0,0) it will render two -- one from (-30,0,0) and one from (+30,0,0) or so.. So we can exploit this by creating TWO image planes which are so small that they don't overlap and putting them right in front of the cameras. So, using my previous numbers (and the coordimate system for my 3d demo), one image plane would be centered at (-30,0,30) and the other at (+30,0,30). Each camera will only see one image plane. This might be a workable solution, but I see three problems: 1. How does one determine the exact 3D camera positions to correctly place the two image planes? I assume this shouldn't be too hard - just look in nVidia's registry entries. 2. How does one enable the 3D glasses in software if the "Enabled by Hot Key" option is on? 3. This is the real kicker. If the cameras/renderer are mathematically correct then they will have _perspective_, which will distort the image I'm trying to display. Even if the texture renderer doesn't account for perspective across a single poly, there will be a discontinuity between the two triangles which make up the square plane. I guess one could apply an 'anti-perspective' transform but this would be very CPU intensive and thus undesireable.. One could also minimize this effect by setting the cameras for a very narrow field of view (high zoom) and putting the image planes far away.. However I've never coded D3D so I don't know if it's possible to set the FOV, plus this method has the additional disadvantage that if the user presses the hotkeys to alter the stereo separation the image planes will go totally out of view. Is this the solution that you were envisioning?? If so how did you solve the issues I've mentioned? |
David C. Qualman
Rating: N/A Votes: 0 (Vote!) | Posted on Friday, April 26, 2002 - 6:50 pm: | |
I have released a new version of WINx3D, which can support page-flipping on the nVidia cards. For 95/98/Me, WINx3D totally avoids the detonator method of page-flipping, and is much more reliable. For NT/2K/XP, WINx3D uses the detonator stereoscopic drivers, using the techniques provided by nVidia. So, we have effectively wrapped the solution that nVidia uses in their image viewer. WINx3D, and our Software Development Kit, is available from www.win3d.com. I can't publish their solution, but I can give some individual assistance. |
David C. Qualman
Rating: N/A Votes: 0 (Vote!) | Posted on Friday, April 26, 2002 - 7:08 pm: | |
Richard, I have been thinking about your analysis. I am pretty sure that in your point 3, that if the image planes are parallel to the screen, then the perspective would just cancel out. That is, assume that you project four rays from an eye into each corner of a rectangular screen. Then, if we have a plane that intersects the four rays, and if the plane is parallel to the screen, we will create a rectangle from the four intersection points. Not an arbitrary quadrilateral, but a rectangel that is of the same shape as the screen, just scaled. Thus, your image plane would not need to be perspectively corrected. It would only need to be scaled and positioned correctly, so that the corners of the rectangular image plane are coincident with the projected rays. This would only work if the each of the image planes are so close to the cameras that they are not within the viewing frustum of the other eye. |
M.H.
Rating: N/A Votes: 0 (Vote!) | Posted on Friday, April 26, 2002 - 9:25 pm: | |
Richard G: You have got it yourself, you are the one ! I did not solve it fully (it was not originaly my idea) but it works a bit. It has all the problems you mention. It is nessesery to add the geometry futures indicated by David. Richard: Thank you for your explanation. I was originaly thinking that you use just this method (D3D scene with geomety optimized to see specific polygons in each eye). You are more original. But I thing that this disussion is obsolate now becouse the stereoscopic support in Winx3D library is all what we need .... |
Richard
Rating: N/A Votes: 0 (Vote!) | Posted on Friday, April 26, 2002 - 11:22 pm: | |
David, I believe that you are correct that the method discussed will not have perspective problems, but only because 3D engines do not render reality accurately. Imagine that you have a 3x5 index card, and you make two marks on it. Both marks are vertically centered horizontal lines, 1 mm long. One is in the very center of the card, while the other is on the right edge. Imagine putting this card close to your nose. The center line will appear to be 1mm long, but the line on the right edge will appear shorter, because of perspective.. You're looking at it at an oblique angle, so its length appears to be 1mm * sin(angle), where the angle is between the line from your eye to the mark, and the index card. However I believe that perspective correction is still a vertex operation, and not accounted for by the pixel shader. If so, then the final image should look correct, and the sizing and placement geometry would be the only concern. The WinX3D library looks like a fantastic piece of software, and I may end up including it in my software. I'm still hesitant though because my 3D demo/screensaver is my *baby* and I've personally written and tested every single line of code. It's my work of art, and it's finally (after about 5 years) almost ready for release. I'm concerned about the size (the exe is 116k now - the core demo and renderer are 100% MMX assembly) and want to keep the amount of unused code to zero Richard It's gonna be so cool to have the 3D working again - thank you guys very much. |
Anonymous
Rating: N/A Votes: 0 (Vote!) | Posted on Saturday, April 27, 2002 - 11:41 am: | |
Richard, make 2 versions, one 2D with your own code and one real3D with the Winx3D library. |
David Sykes
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, May 13, 2002 - 5:31 pm: | |
The Winx3D solution is interesting but unfortunately only works in full-screen page-flipped mode. I relished the idea of a page of stereo thumbnails, which presumably is possible with OpenGL ? The SDK docs state :- "Presently, the only renderer-specific layer is for DirectDraw. It is possible to replace this layer with others, to give stereoscopic support to other renderers. Hypothetically, this could be for OpenGL, or perhaps for GDI". Stereo in a window would be useful :-)) David Sykes |
|