New indiepath.modules
BlitzMax Forums/BlitzMax Programming/New indiepath.modules
| ||
Indiepath.ProjMatrix - Projection Matrix - now MacOS compat. Indiepath.TexturedPoly - Now independent of the Official Mods and MacOS compat, contains the New DrawGlowingLines command. Get files and examples here :- http://indiepath.com/public/indiepath_mod_update.rar Screenie of Example: |
| ||
you da man. Thank you very much for these and for your constant hard work and generosity to the community. |
| ||
. |
| ||
Great work!. BTW, there's no other commands for the Matrix?. Something like: ProjectionMatrix.Initialize(1000,700,CurrentScreenX=800,CurrentScreenY=600) So, We can force the projection matrix to work thinking is 800,600 |
| ||
Thanks. |
| ||
@BlackSpider, sorry it was late when I wrote those crappy instructions.. if you want 800 x 600 then the command is ProjectionMatrix.Initialise(800,600); It now does not matter what your real screen resolution is. There are other commands like zoom and rotate but they don't work quite right yet. |
| ||
Thanks |
| ||
Indiepath, check the next code and you will understand why I'm asking to force the matrix. I'm using 2 times graphics to force the matrix. Graphics 800,600,0,60 Projectionmatrix.Initialise(1000,700) Graphics 600,600,0,60 with the key 'W' you can change the screen mode. |
| ||
I really am not sure what the issue is here? I do see one error in your code, you have to set the projection matrix after SetGraphics, which kinda makes sense. '*********************************** Graphics 600,600,0,60 Projectionmatrix.Initialise(1000,700) '*********************************** And if I remove your code that justifies the screen when FullScreen it looks the same in both modes. |
| ||
Indiepath, this is really cool, thanks! Works great when using DX7 but GL gives an "attampt to access field or method of null object" error when textured poly is used. Looking at the debugger, both driver fields (DX and GL) are null. Any ideas? |
| ||
Strange, I don't get that error here on Win or OSX in openGL. I've made a new version anyway which I might upload tomorrow. |
| ||
thanks |
| ||
. |
| ||
@BlackSp1der, the command is not doing what you think it is. The Graphics command does not set the base resolution, the ProjectionMatrix does. Take the following example, the pixels will always be in the corner of the screen regardless of resolution. Graphics 800,600 'Graphics 480,360 'Graphics 1024,960 ProjectionMatrix.Initialise(640,480) Plot 0,0 Plot 640,0 Plot 640,480 Plot 0,480 Flip |
| ||
I get the same error as TeaVirus when going GL. "attempt to access field or method of null object" /svensken |
| ||
The ProjectionMatrix mod is cool to play with, but when in use the screen coords are still mapped to display resolution making any game that uses any kind of mouse/screen interaction a lot less usefull. its fun to play with though. |
| ||
Yeah but remapping your mouse is so easy to do, it's easier than remapping every image.Local ActualWidth# = 480 Local ActualHeight# = 360 Local BaseWidth# = 800 Local BaseHeight# = 600 Local NewMouseX# = (Float(MouseX())/ActualWidth)*BaseWidth Local NewMouseY# = (Float(MouseY())/ActualHeight)*BaseHeight |
| ||
My error report above was somewhat misstated. It's actually the DXFrame and GLFrame fields that are null. I've tried again after a complete reinstall using the new 1.16 release and same problem. |
| ||
Seems like you are not passing an Image or the incorrect frame. |
| ||
Hi Tim, just have seen it...nice one! Strict Import indiepath.texturedpoly Import indiepath.projmatrix AppTitle = "Subtle Glow" 'SetGraphicsDriver D3D7Max2DDriver() SetGraphicsDriver GLMax2DDriver() Global scrX:Float=960,scrY:Float=600,scrXm:Float=scrX*.5,scrYm:Float=scrY*.5 Graphics scrX,scrY,0 projectionmatrix.Initialise(scrX,scrY) SeedRnd(MilliSecs()) Local Image:TImage = LoadImage("glow2.png") Local ImageFrame:Int = 0 Local x0# = 300 Local y0# = 100 Local x1# = 400 Local y1# = 200 Local width# = 16 Local anz:Int=360,fakCol:Float=255/Float(anz) Local i:Int=0 Local akt1:Float=0.0,del1:Float=10.0,ste1:Float=0.1,amp1:Float=100.0,spi1:Float=1.2 Local akt2:Float=30.0,del2:Float=7.0,ste2:Float=0.8,amp2:Float=180.0,spi2:Float=0.4 Local xold:Float=0.0,yold:Float=0.0 Cls While Not KeyDown(Key_Escape) SetBlend LIGHTBLEND akt1:+ste1 akt2:+ste2 For i=1 Until anz SetAlpha(Sin(i*180.0/anz)) SetColor(255-i*fakCol,i*fakCol,255) akt1:+del1 akt2:+del2 If akt1> 360.0 Then akt1:-360.0 If akt1< 0.0 Then akt1:+360.0 If akt2> 360.0 Then akt2:-360.0 If akt2< 0.0 Then akt2:+360.0 x1=(amp1+i*spi1)*Sin(akt1) y1=(amp2+i*spi2)*Cos(akt2) If i>1 Then x0=xold y0=yold DrawGlowingLine(Image,ImageFrame,x0+scrXm,y0+scrYm,x1+scrXm,y1+scrYm,width) End If xold=x1 yold=y1 Next Flip;Cls Wend End Greetings, taumel |
| ||
I got a new version coming soon.....It's been heavily optimised. |
| ||
I get the same problem as Teavirus even running Taumel's code with the max.png file. <edit> Driver issue (?) as works with DX but not GL on my laptop. I'll check later on my PC. |
| ||
Indiepath, Inspecting the indiepath.win32.*.i files it doesn't look like brl.glmax2d isn't imported in the version you've uploaded. ModuleInfo "Version: 1.0" ModuleInfo "Author: Tim Fisher" ModuleInfo "License: Public Domain" ModuleInfo "Modserver:Indiepath" import brl.blitz import brl.d3d7max2d import brl.pngloader import brl.retro DrawTexturedPoly%(Image:TImage,frame%,xyuv#&[],RenderType%=6)="indiepath_texturedpoly_DrawTexturedPoly" DrawGlowingLine%(Image:TImage,frame%,x0#,y0#,x1#,y1#,width#=1#)="indiepath_texturedpoly_DrawGlowingLine" |
| ||
Well thats kinda odd because I've got that version running on my Mac??!? |
| ||
The Mac version does import brl.glmax2d. =) texturedpoly.release.macos.i ModuleInfo "Version: 1.0" ModuleInfo "Author: Tim Fisher" ModuleInfo "License: Public Domain" ModuleInfo "Modserver:Indiepath" import brl.blitz import brl.glmax2d import brl.pngloader import brl.retro D3DPT_TRIANGLEFAN%=9999939 D3DPT_TRIANGLESTRIP%=12536753 DrawTexturedPoly%(Image:TImage,frame%,xyuv#&[],RenderType%=9999939)="indiepath_texturedpoly_DrawTexturedPoly" DrawGlowingLine%(Image:TImage,frame%,x0#,y0#,x1#,y1#,width#=1#)="indiepath_texturedpoly_DrawGlowingLine" |
| ||
I'm going to upload the new version some time anyway.... It's got a massivly improved renderpipeline, especially in OpenGL. |
| ||
I look forward to trying it. Thanks!! |
| ||
Just came across the projection matrix - fantastic stuff Indie! I was wondering though, how to handle widescreen monitors? I currently set the projection matrix to 1024*768 and then whatever monitor I run on everything scales nicely up to full screen. But for a widescreen monitor I don't want this because the images all get stretched. It's not so bad on a flatscreen with a ratio of 5:4 instead of 4:3 but most laptops seem to be widescreen these days. |
| ||
I'd suggest setting the projection matrix to the resolution of the monitor you are running on. Perhaps have a switch in game that allows the user to select widescreen mode. |
| ||
Thanks Indie. In the end what I have done is utilise your projection matrix in conjunction with the GUI module, since my game uses a gui canvas for graphics (as I need to use gadgets). So what I have done is create a base full screen window (sized to whatever the monitor is set at). Then the game window sits on this it's size is adjusted according to the aspect ratio of the monitor - so that the window always appears in 4:3 ratio. Then I can just colour/texture the base full screen window, so that bars (down the sides for widescreen or top and bottom for 5:4) don't look out of place. Using the projection matrix makes this all work really nicely - monitors that are in a 4:3 aspect ratio run in complete full screen, and 5:4 and widescreen are scaled up as much as possible whilst still maintaining 4:3 ratio, and the unused sections of the screen are masked with an appropriate texture. Probably not how other people do this, but I am happy with the results, if anyone does want to see then here is some example code: thanks again Indie. Global varScreenWidth : Float = 1024 Global varScreenheight : Float = 768 Global varXScaleFactor : Float = Desktop().width / varScreenWidth Global varYScaleFactor : Float = Desktop().Height / varScreenheight Type typInterface Field gdtParentWindow:TGadget Field gdtWindow:TGadget Field gdtCanvas:TGadget Field gdtTextBox:TGadget Field gdtChatBox:TGadget Field blnChatInitialised:Int = False Field fntChatBoxFont:TGuiFont=LoadGuiFont( "Verdana",10,True) Field intSelectedChatLine:Int = 0 Method InitialiseGameWindow() Local varWidth:Float = Desktop().width Local varHeight:Float = Desktop().Height Local varRatio:Float = varHeight / varWidth 'Fix the aspect ratio to 4:3 by creating a full screen parent window then sitting a window sized to the maximum allowed 'whilst still keeping a 4:3 ratio. Then use Indiepaths fab Projection Matrix to ensure graphic and positions are scaled correctly Self.gdtParentWindow = CreateWindow("", 0, 0, ClientWidth(Desktop()), ClientHeight(Desktop()), Null, 0) If varRatio < 0.7 'widescreen Self.gdtWindow = CreateWindow("", (varWidth - (varHeight * 1.25)) / 2, 0, varHeight * 1.25,varHeight, Self.gdtParentWindow, 0) varXScaleFactor = (varHeight * 1.25) / varScreenWidth varYScaleFactor = varHeight / varScreenHeight Else '4:3 or 5:4 ' Self.gdtWindow = CreateWindow("", 0, 0, ClientWidth(Desktop()), ClientHeight(Desktop()), Null, 0) Self.gdtWindow = CreateWindow("", 0,(varHeight - (varWidth * 0.75)) / 2, varWidth,varWidth * 0.75, Self.gdtParentWindow, 0) varXScaleFactor = varWidth / varScreenWidth varYScaleFactor = (varWidth * 0.75) / varScreenHeight EndIf Self.gdtCanvas = CreateCanvas(0, 0, ClientWidth(Self.gdtWindow), ClientHeight(Self.gdtWindow), Self.gdtWindow) SetGadgetLayout(Self.gdtCanvas, 1, 1, 1, 1) SetGraphics CanvasGraphics(Self.gdtCanvas) ActivateGadget(Self.gdtCanvas) EnablePolledInput() projectionmatrix.Initialise(1024,768) 'This ensures that the game graphics display in full window regardless of the monitor setting EndMethod |
| ||
Is it possible for these modules to go onto the axe.mod server with the other useful module built by users? It seems like a lot of people find Indie's mods really useful and it sounds like if Skid is contacted directly he may maintain these (it must be a complete pain for Indie having to look at these again after each release): http://www.blitzbasic.com/Community/posts.php?topic=57472&hl=axe |
| ||
if/when I sell them I will maintain them, that is the only reason for me charging any money. |
| ||
Hi Indiepath. I've just tried out your DarTexturedPoly-Module, but it seems, there are a few bugs in it. First: It only works with D3D. If I try to draw a textured Poly in OpenGL, it crashes with the error, TeaVirus mentioned some posts ago. Second: There has to be a Bug with the Vertex-Coordinates. I draw a non-textured-BMax-Poly (a simple Quad). Then, I draw a textured Poly at the same position (Texture has no transparent/masked space), but it does not overlap perfectly, as it should. At the right side and at the lower side there are some pixel-lines missing. The Image's scale seems to be incorrect. Here are my coordinate-arrays: Poly: 100.0, 100.0, 190.0, 100.0, 190.0, 190.0, 100.0, 190.0 Textured Poly 100.0, 100.0, 0.0, 0.0, 190.0, 100.0, 1.0, 0.0, 190.0, 190.0, 1.0, 1.0, 100.0, 190.0, 0.0, 1.0 It would be nice, if you fixed those bugs, i could really use a DrawTexturedPoly-Function right now.. :/ Edit: I've got a feature request too: Could you, optional, in a second array support Vertexalpha and Vertexcolor? That would be REALLY cool =) |
| ||
Indiepath? Answer? ^^ |
| ||
The new, unlreleased version is fixed and has the additional features you wanted including lit vertexes, specular and Dot3. As with most things, when I have the time I will release it. |
| ||
*waiting for 1.18 versions of your modules :-)* Good work |
| ||
I assume, that Specular and Dot3 have something to do with Bumpmapping? ^^ |
| ||
Tim, what happened with the plan to sell these modules? It would make me feel less guilty about hassling you for error fixes and updates. |
| ||
That sounds great Indiepath. Good luck with finding that time ;) |
| ||
I apologise if people are getting mixed messages from me about what I'm going to do any when. The bottom line is that I'm absolutely maxed out at the moment, and whilst these modules are low priority for me I do understand that they may be high priority for you. Perhaps there is someone on this forum who would like to handle the sale of the modules, and front-line support, for a healthy chunk of the revenue? |
| ||
oh yeah please, someone needs to do that, there is more than enough talent on these boards to head that up. |
| ||
Whoa, that must have scared everyone away. |
| ||
Apparently. i am ready to buy even though my wallet is quite thin. but i dont have the time and experience to help you sell and support it. I sorta wished someone would have raised her voice though. Well good luck anyway. i will look forward to the day i can get my hands on them. till then i will have to do with what i have |
| ||
I think, I'd buy too, but it really really hope, that it will be a fair prize. |
| ||
Is this still about? |
| ||
The modules have been release to the public ... at least render2texture and the polygone part when I remember right (only use r2t) |
| ||
Its the polygon part I was interested in, but I cannot find a working link. Anyideas where it is? |
| ||
We removed all the modules from the public domain due to the ridiculous number of support emails we were getting. We really thought people would use the modules to learn from - but alas everyone wants us to debug their games - not a chance. |
| ||
We really thought people would use the modules to learn from Did you release the source code, at some stage then? I must've missed that. |
| ||
Ok. Can you posibly post the code to TexturedPoly? If not, could you advice me as to the best way to aprocah this problem. Because all the "Good" searches contain soly this as the solution. (Thats not true, but close enough ;) Ive been trying to do it, For "Petty" changes to a simple quad, by a combination of pixgrab/resize and Setrotate/scale this means, (Because of how slow it is) that most times Ive had to "pre-create" a set of images. The other solution Ive been looking at was simply follow the Nehe Tutorial 6, and use gl, but... (It would be the first time Id used any of the Gl stuff, and I get lost really quickly) Was your method OpenGl dependent? If not how was it done. Thanks |
| ||
The easiest way is to take the BM sources as start. Both, DX and OpenGL drivers already feature polys but implicitely want that no texture is bound ... so all you theoretically need to do is bind a texture ie copy the code and allow it to work with a set texture. I've that in my source and works without probs (I manually feed it with vertex - uv arrays) |
| ||
Well, dont suppose you would like to explain that in a tutorial would you? |
| ||
Did you release the source code, at some stage then? I must've missed that. Yes I did release the source code to all the modules. |
| ||
No H&K, sorry. But as mentioned, check the BM sources, they will give you a quite good starting as they have everything in you need to get a basic understanding. The rest is just creating of functions to use it in a less cryptic way :-) And those functions heavily depend on your needs. Some use it to create isometric tiles from their textures, other use it for funky effects etc. |
| ||
includes Tim's DX TexturePoly plus GL TexturedPoly. |
| ||
Indiepath's modules are nice, it's a pity i missed it :| |
| ||
I've been approached by an individual who is interested in maintaining the modules on the behalf of Indiepath. I am looking forward to their proposition. |
| ||
So it will possibly got maintained when there's a new BMax version that break module compatibility? |
| ||
Soo... some people got it for free... and now some people have to pay? huh? How much? When? |
| ||
Actually modules are free, and "TexturedPoly", "Render2Texture", "ProjectionMatrix" are publically open sourced, very great piece of mods. I just afraid Mark will break the modules again.... in the next update. |
| ||
Looks like the 3rd party is not going to be involved after all. The modules look like they will stay in-house. |
| ||
@Indiepath: Could You please explain how these mods are alowed to be used? Does one need a licence to use them for games? I was thinking of including Render2Texture in my GUI, but that is probably a big no-no? |
| ||
@yoxola, Actually modules are free, and "TexturedPoly", "Render2Texture", "ProjectionMatrix" are publically open sourced, very great piece of mods. Brilliant, Linky? Then again maybe you missed this We removed all the modules from the public domain and this My Other modules rely on this core module so I decided to release it Free of charge. This is not Open Source even though source is included. (But equaly I might just be stupid in my searches for it) Edit: http://www.blitzbasic.com/Community/posts.php?topic=51059#569148 IndiePath, if I promise not to ask any questions about it at all, could you let me have TexturedPoly? |
| ||
http://www.pyroplay.de/softshadows.html Follow tonyg's site and you can get 2 of them, but ProjectinMatrix was removed with indie's closure of hismodule board. Without his permission I can't distribute it tho... I really want to start a project like PBOSL that collect open-sourced libraries in a convenient pack, I may call it BMOSL.... I have space now, just need time to make a site of it. |
| ||
lol, bacause it was in rar, ive had it sitting unopened on my hd. Thanks everone. |
| ||
If you have concerns about the license then please email me. With regard to restrictions, there are none other than I would urge you to credit Indiepath for providing the code - that is all. |
| ||
It's me or there is a problem with bmax 1.24 on the : primarydevice.device ?? |
| ||
most likely. Read this: http://www.blitzbasic.com/Community/posts.php?topic=65846 |
| ||
Hum :) Many thanks Grey Alien, but i have try to convert indiepath textured poly module but without result... There too many changes :/ If anybody convert indiepath glow vector module for 1.24 let's roll :) With the new driver changes, what the new commands for this line ? If TD3D7Max2DDriver(_max2dDriver).IsLost=False Any idea ?? |
| ||
I have find : TD3D7GraphicsDriver.IsValid |
| ||
Textured poly was no big problem to update for me. Im stuck at rendertotexture though |
| ||
Perhaps someone could email me the updates they have already made - no point doubling up on work:) |
| ||
My last version seem to work, but i'm not really sure of the modifications ? Can you give me an email adress indie ? :) primary.device was replaced by : D3D7GraphicsDriver().Direct3DDevice7() I hope that good ? But seem compile without error |
| ||
just whack something over to indiepath.com |
| ||
Is there the Lights2D module available again? That one is useful and I hope to see it working on 1.24 (and later versions). I'd want to pay/donate for the Lights2D source, for learning purpose(didn't have attempt to make game for a long while, but still playing BMax...) |
| ||
Anyone gotten this to work? I need to re-compile the mods to get my games working again :| |
| ||
nm, it's working now :) |