MiniB3D meets Max2D
BlitzMax Modules Forums/MiniB3D/MiniB3D meets Max2D
Hi, again something new from side. Because of some questions about using Max2D with miniB3D in the german community I hopefully have found the solution.
Could all windows user please test this:
http://klepto2.kl.funpic.de/DL/minib3dmeets2d.rarIF you have problems running the above sample then please try this one:
http://klepto2.kl.funpic.de/DL/meets2d(original).rarthis one uses the original V0.30 modified for Max2D use. hopefully this will work.
And post the result (working/not working)
thx
Brilliant, works well. Win XP Pro SP2 , Radeon 9600XT
Does not work at all here on my fathers computer. A black windows pops up and then dissapears. No errormessage or anything.
Win XP SP2 integrated intel graphics.
does the original version of minib3d work with your PC?
Unfortunatly it seems to rely on the integrated intel chip :(
And maybe it doesn't support some extensions used by my mod.
works here.
Same as with deps.
The Window pop-up and disappear.
But MiniB3D works fine.
sounds very good :)
btw: for all of you (and all the others) here is the new RenderWorld Function from TGlobal :
Function RenderWorld()
glMatrixMode GL_PROJECTION
glLoadMatrixd TGLobal.ortho_pj
glMatrixMode GL_MODELVIEW
glLoadMatrixd TGLobal.ortho_mv
TGLobal.EnableStates()
glPopAttrib
SetBlend SolidBlend
For Local cam:TCamera=EachIn TCamera.cam_list
If cam.EntityHidden()=True Then Continue
RenderCamera(cam)
Next
Local x,y,w,h
GetViewport(x,y,w,h)
glDisable(GL_LIGHTING)
glDisable(GL_DEPTH_TEST)
glDisable(GL_SCISSOR_TEST)
glDisable(GL_FOG)
glDisable(GL_CULL_FACE)
glMatrixMode GL_TEXTURE
glLoadIdentity
glMatrixMode GL_PROJECTION
glLoadIdentity
glOrtho 0,GraphicsWidth(),GraphicsHeight(),0,-1,1
glMatrixMode GL_MODELVIEW
glLoadIdentity
SetViewport x,y,w,h
For Local Layer = 0 Until THardwareInfo.MaxTextures
glActiveTexture(GL_TEXTURE0+Layer)
glDisable(GL_TEXTURE_CUBE_MAP)
glDisable(GL_TEXTURE_GEN_S)
glDisable(GL_TEXTURE_GEN_T)
glDisable(GL_TEXTURE_GEN_R)
glDisable(GL_TEXTURE_2D)
Next
glActiveTexture(GL_TEXTURE0)
DrawRect -10,-10,5,5
End Function
The functions were already posted in a previous thread, but they seemd to produce some errors. This is solved by just resetting the SetBlend to SolidBlend before rendering the 3D part.
[Edit]
A new Version is online (using the original V0.30) see first post.
[/Edit]
The new Version works fine :D
Good job!
works great on my laptop..
The second link does not work either.
Seems like MiniB3D does not like integrated intel graphics.
That's likely; What I've seen of the older Integrated Intel Graphics tells me that they hate Open GL :(
(Which is definietly not a good thing, since loads of casual gamers have integrated graphics!)
Works fine here.
Intel P4 3,2Ghz | Radeon mobility 9100 128mb | 512mb Ram
Being able to use Max2d for a GUI or HUD would possibly be the best thing ever!
older integrated Intel had no 3D acceleration, which is most likely why they do not like OpenGL or better: They at best support 1.1 / 1.2 but no extension as they use fallbacks to the OS drivers (they are not much better on D3D7 after all. their performance and stability differs massively from version to version of the drivers. Older intel work best on DX8 / 9 ... Only Intel Extreme series are 3D chipsets. And just to mention that: S3 and SiS are no 3D chipsets as well)
Works here on both machines (P-M 1.5Ghz, Radeon 9700 Mobile | Core Duo T2500, GF 7600 Go)
The functions were already posted in a previous thread, but they seemd to produce some errors. This is solved by just resetting the SetBlend to SolidBlend before rendering the 3D part.
Nice work! Really need 2D. What do I do? Do I just pop the above function into MiniB3D or do I need the functions already posted in a previous thread as well? How do I use Max2D with MiniB3D?
Hopefully simonh will integrate this in 0.40.
No problem running the demo
Sveinung
You just have to insert the following things for the original
minib3d:
Global ortho_mv![16],ortho_pj![16]
Function RenderWorld()
glMatrixMode GL_PROJECTION
glLoadMatrixd TGLobal.ortho_pj
glMatrixMode GL_MODELVIEW
glLoadMatrixd TGLobal.ortho_mv
TGLobal.EnableStates()
glPopAttrib
SetBlend SolidBlend
For Local cam:TCamera=EachIn TCamera.cam_list
If cam.EntityHidden()=True Then Continue
RenderCamera(cam)
Next
Local x,y,w,h
GetViewport(x,y,w,h)
glDisable(GL_LIGHTING)
glDisable(GL_DEPTH_TEST)
glDisable(GL_SCISSOR_TEST)
glDisable(GL_FOG)
glDisable(GL_CULL_FACE)
glMatrixMode GL_TEXTURE
glLoadIdentity
glMatrixMode GL_PROJECTION
glLoadIdentity
glOrtho 0,GraphicsWidth(),GraphicsHeight(),0,-1,1
glMatrixMode GL_MODELVIEW
glLoadIdentity
SetViewport x,y,w,h
Local MaxTex:Int
glGetIntegerv(GL_MAX_TEXTURE_UNITS, Varptr(MaxTex))
For Local Layer = 0 Until MaxTex
glActiveTexture(GL_TEXTURE0+Layer)
glDisable(GL_TEXTURE_CUBE_MAP)
glDisable(GL_TEXTURE_GEN_S)
glDisable(GL_TEXTURE_GEN_T)
glDisable(GL_TEXTURE_GEN_R)
glDisable(GL_TEXTURE_2D)
Next
glActiveTexture(GL_TEXTURE0)
DrawRect -10,-10,5,5
End Function
simply add the globals to TGlobal and replace renderworld()
for my modified version you have to add the globals and replace renderworld by the code of the first post.
Neither one works in Vista 32bit. A screen opens then flashes. I even tried the compatibility options, and still does not work.
Pent4 3ghz, 2 gig ram, ATI 850XT w/ 256mb ram
Jason
.
Working beautifully on Radeon 9600 Pro with an Athlon 2500+ (1.8 gHz).
60 FPS for the whole thing.
Working fine on an Nvidia GeForce 4 MX 440, Win XP Pro SP2
ca 60 FPS
Well done !
Works fine on my desktop (Nvidia GF6600) + notebook (ATI X700).
@Jason W. :
I really don't know much about Vista, but I think it crashes because the test app will run in window mode and as far as I know Vist just emulates OpenGL in Window mode. Just a guess.
Works fine
FSC PC with SIS graphicscard
and
on XP sp2 with GF6800
Also works fine here!
AGP GeForce 4TI-4200 on XP SP1
Works here for both versions.
Win XP SP 2, ATI X600, Centrino 1.6 GHZ, 1024 RAM
works
60 fps
xp sp2 6200 gf
You just have to insert the following things for the original
minib3d: [...] simply add the globals to TGlobal and replace renderworld()
I added the above to MiniB3D v 0.30. Crashes on MacOS X (10.4.8, G4 PPC, GeForce4 MX) as soon as I add the new RenderWorld() function.
Sorry, I should have debugged it first and then posted! Here is the problem and the solution. The glActiveTexture() crashes so you have to replace them with glActiveTextureARB(). That is all. It now works on Mac as well. Getting a good 60+ FPS. Great work. Thanks klepto2!
For Local Layer = 0 Until MaxTex
glActiveTextureARB(GL_TEXTURE0+Layer)
glDisable(GL_TEXTURE_CUBE_MAP)
glDisable(GL_TEXTURE_GEN_S)
glDisable(GL_TEXTURE_GEN_T)
glDisable(GL_TEXTURE_GEN_R)
glDisable(GL_TEXTURE_2D)
Next
glActiveTextureARB(GL_TEXTURE0)
This is great! Makes my programming much easier. Thanks!
I do have a question, though. I saw on another thread that you had implemented basic shaders for MiniB3D. Was that shader code generic (i.e. could be used to load any frag and vert text files for programmable shaders), or did it just implement the shaders you were using at the time. I think my next project would really benefit from toon shading, and though the shaders themselves seem somewhat easy to understand (with pretty good examples on the net of toon shading), implementing it in MiniB3D is a little beyond me...
A few of my favorite resources (to show what kind of shader I'm talking about):
http://www.clockworkcoders.com/oglsl/tutorial10.htmhttp://www.lighthouse3d.com/opengl/glsl/index.php?toonAnd one link to an older non-shader version (that I can't even begin to understand how to do):
http://www.gamedev.net/reference/articles/article1438.aspAny pointers in the right direction or links to other info to help get me started? Thanks for your continued work (the Blitz community is the best; you, simonh, gman, and lots of others!)
Basically you could use every glsl shader with my implemtation. I'm currently working on different things (also some shader samples for the next release). My first shaders where also from lighthouse3d. But a small hint: try to program the shaders as strict as possible, because the compiler on Ati and nvidia will handle the source different (ati is more strict than nvidia). So stay strict and you will be fine.