2d graphic commands in Graphics3D modeBlitz3D Forums/Blitz3D Bug Reports/2d graphic commands in Graphics3D mode
| Hi guys. Don't know if this is a bug, but it's driving me nuts! I recently re-installed windows, and just put blitz3d back on. Problem is, all 2d graphic commands have stopped working when using Graphics3D mode. I can write a basic two-line program to test it:|
and nothing shows. If I use 2d mode and type
it plots the dot fine. In 3D mode though, none of the graphics are drawing onto the screen. I've noticed it happens now in all my programs. Not sure what the issue might be? Text still goes fine in both 2d and 3d mode.
I'm on Vista, but then, I've been Blitzing on Vista for years, and never had a problem, so I don't think that is the problem. I've patched Blitz to the latest version, but I tried uninstalling, and only patching to some of the previous versions, and 2D still doesn't draw when in Graphics3D mode...
EDIT: forgot to mention. Geforce GTX 560 TI graphics card, and latest version of Direct X and Nvidia drivers (I think).
Last edited 1+ years ago
| The Graphics3D command sets the back buffer as the default drawing buffer (because 3D can't be drawn to the front buffer), as opposed to Graphics which defaults to the front buffer.|
In a more complex program you would probably never see the difference, since almost everyone uses the back buffer for 2D work, and almost everyone redundantly declares "SetBuffer BackBuffer()" after Graphics3D out of habit.
Anyway the short answer is that you need to either flip, or change drawing buffers.
Last edited 1+ years ago
| Hi! Yes, I'm flipping in my programs. I set the buffer to back buffer, then in my main routine, I use:|
(all 2d text and graphics in here)
I've been doing this for years, and never had a problem before. I've got dozens of programs, and I haven't made any changes to their code - they all usually work, but now the 2D graphics are not there in any that have the Graphics3D command. I've noticed that its only the graphic elements (plot, line, etc) and that text is still working fine, and will display.
| Here is a test, with 3D and 2D graphics, plus text. It works for me, Windows 7 64-bit and nvidia.|
Edit: Compatibility mode is set to Windows XP, Service Pack 3.
Graphics3D 800, 600, 0, 2 ; windowed, but it shouldn't matter SetBuffer BackBuffer() ; not really necessary cube = CreateCube() cam = CreateCamera() PositionEntity cam, 0, 0, -4 While Not KeyDown(1) RenderWorld TurnEntity cube, 0.01, 0.02, 0.03 Color 255, 255, 0 Text 50, 50, "Yaw is " + EntityYaw(cube) Color 20, 200, 20 Rect 50, 70, 110, 30 Flip Wend
Last edited 1+ years ago
Okay, I've run it to see what would happen. There is a grey cube slowly spinning in the middle of the screen, and in the top left is some yellow text which is reporting the Yaw of the cube. There's no rectangle drawn on the screen anywhere though.
I also tried running it again, this time with Win XP compatability turned on, but it didn't make a difference :(
| Well that's a mystery.|
So this used to work on the same hardware with Vista before the reinstall? I wonder if there is some problem with Vista and the latest nvidia driver.
| Try explicitly installing DirectX 9 as well?|
(DX9 and DX10/11 will coexist without issues)
| Okay, took a while to find a full install download of dx9.0c but I tried it, and it didn't fix the problem. I seem to recall the program is based on dx7 anyhow, so I also found a download of dx7 (which I had to try installing in compatability mode to make it install) but that did nothing either... Not sure what to try next. |
| Can you use the Read- and WritePixelFast commands? They probably won't work if Rect doesn't, but it's worth checking as they're the simplest 2D commands; if they don't work the issue is almost certainly outside anything to do with B3D.|
I can't remember now, but I think Text might go through some completely unrelated Windows text-drawing layer, and therefore may work when everything else doesn't simply because it's using something else to put the pixels in place, which would explain the inconsistency.
Perhaps try reinstalling the drivers or rolling back driver versions? True-2D support has been less than great for a few years now (for practical purposes you shouldn't generally be using pixel-2D), but not working at all is another matter, and not acceptable if it's Nvidia's doing. If you can get it working by rolling back driver versions then that's a serious bug that needs a report to Nvidia.
Also, you don't need to download DX7 if you have DX9; the latter includes the former.
| Hmm. I ran the code sample for read / write pixel fast, and got a memory access violation. This was just with Graphics command too, and not Graphics3D command. On an impulse, I ran it in full screen mode - and it worked! However, when I then tried running the sample using Graphics3D, in window and in full screen, it did not work at all. I'm going to uninstall the Nvidia driver, and try installing an old Nvidia driver, and see if that does anything. |
| SOLUTION FOUND:|
Okay, so it's the Nvidia Drivers. I uninstalled the latest driver, and installed an older one off my backup hard drive - and all the programs work now, all the 2d graphic elements draw perfectly fine in Graphics3D mode now. So they've definitely changed something in their latest Nvidia driver.