I need tutorial and instructions how to install render2texture mod

Started by takis76, August 18, 2018, 01:29:42

Previous topic - Next topic

takis76

Hello,
I decided to download this famous Render2Texture mod from GitHub.
But just copying the files in mod directory of BlitzMax it doesn't work. It suppose to be updated.

The GitHub instructions are very poor or not exist at all. There is no tutorial and guide how to install it.
I have the Blitzmax version 1.50

There is one file in the Render2Texture with name README.md
This file says you need to copy the d3d9graphics.bmx in the existing brl directory of Blitzmax
c:/blitzmax/mod/brl.mod/dxgraphics.mod/
You are replacing the file (Make a backup before).
Then you compile the dx mod brl.dxgraphics only with the advanced mod builder of the Blide (The best Ide) to have the updated file compiled and you try to run some from the examples.
After the examples compiles you have an error:
Unhandled Exception:Attempt to access field or method of Null object
In file d3d9max2d.bmx
This file haven't replaced I use the original. I thing and this one needs to be updated.
The error is in the line number: 246


If d3d.CheckDeviceFormat( D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,D3DFMT_X8R8G8B8,0,D3DRTYPE_TEXTURE,D3DFMT_A8R8G8B8 )<0
Return Null
EndIf


After this there is no solution or any guide. Maybe the version of the d3d9max2d.bmx I have should be updated too. But where do I will find it.

Sure you will have the solution, because you already run this library which means you have compiled it and you have the missing or the updated files I am not having here.

If this library will work, maybe I will rewrite my code and do all of these effects I have asked before (If you go back in other posts I tried to have fast image copy and making and underwater effects and other stuff inscluding and light effects and all pointed to this Render2Texture mod.

Thank you.



Derron

The instructions you found are enough:
- download the mod
- put the the altered .bmx file in the correct module folder
- compile modules (it will recompile what it is needed)
- if not sure, just compile all modules (so also the d3d9max2d.mod thing!)

of course it would be a good idea to update your bin/bmk.exe with brucey's bmk.exe (and .bmk files) as it does auto-compile module if needed (and allows for more stuff - like post/preprocessing-scripts to automate some stuff).


@ effects
You cannot do everything with "render2texture" - water effects is more a shader thing (see shaderframework by col).
With render2texture you can for example draw stuff out of multiple elements - and then resize/scale/rotate the complex element in one "go". Think of a ingame menu consisting of multiple buttons, with "drawtext"-text ... If you wanted to fade out the whole menu, you cannot simply do a "setalpha x" before drawing everything, as the buttons then would become transluscent (you can see the menu background _through_ the buttons).

With render2texture you create a render texture for the whole menu, draw all your menu's elements "opacque" (non-faded) on this texture and then you have some kind of image containing the whole menu. This image can then get rendered fading out properly - also resizing (think of this "popping in/popping out") of the wole image is then no longer a hassle.

Without a "r2t" approach you would need to make sure that scaling handles have individual offsets as else elements would scale to their individual center (button sprites would scale to their center - which differs for each button) instead of behaving as if everything was "tied together".


So certain effects could be achieved way easier with r2t as it does not need "grabimage" which is slow. If you'd render your gameboard (your game-stuff..) you can easily draw other stuff dynamically over it. You can shrink/tint/... the whole game, render it twice, ...

But most of the time, as described above, I would use it to avoid complex stuff made of multiple sprites. Btw it makes caching "drawtext" outputs easy!. Why one should do that? Rendering glyph by glyph (char by char) is lowering your FPS (imagine a wall of text: 2000+ draw commands). Caching the output in a texture (especially for static text) will help bringing up your FPS counter.


bye
Ron

col

Quote
The instructions you found are enough:
- download the mod
- put the the altered .bmx file in the correct module folder
- compile modules (it will recompile what it is needed)
- if not sure, just compile all modules (so also the d3d9max2d.mod thing!)
It doesn't get much easier than this although there are a few things that you are expected to know when it comes to module modification.

QuoteThe GitHub instructions are very poor or not exist at all. There is no tutorial and guide how to install it.
Thank you for highlighting this. I've updated the readme.md file that there is a dependency on the srs.d3d11max2d module and included how to 'Build modules' within the standard editor. Any further issues that you may have may be included in the instructions.

QuoteThen you compile the dx mod brl.dxgraphics only with the advanced mod builder of the Blide
This bit wasn't in the instructions ;)

It seems you are building the dxgraphics.mod module manually using the advanced feature of BLide.
In which case you'll also need to re-build any modules that depend on it too. The dxgraphics.mod module is a dependency of d3d9max2d.bmx and d3d7max2d.bmx - therefore you need to manually compile them too.
If you were to build the d3d9max2d.bmx module then its dependencies will get resolved and built again if needed but not the other way around. I really do not recommend using a 'manual module building' feature unless you're very comfortable with the whole BlitzMax build process.

In the worse case if you 'Rebuild all modules' the problem should be gone.
https://github.com/davecamp

"When you observe the world through social media, you lose your faith in it."

takis76

The problem wasn't fixed remains the same.
I copied the d3d9graphics.bmx in my brl directory C:\BlitzMax\mod\brl.mod\dxgraphics.mod (Which I am already did this before).
And I recompiled whole brl mod. (Which I didn't do this before).
And I have the same error when I run the examples.

Where do I will find the Brucey's BMK? I use the default from the blitzmax. (This step is not explained in the non existent instructions).
But in the Render2Texture folder there are and other files like:

d3d9renderimage.bmx
d3d9renderimagecontext.bmx
d3d11renderimage.bmx
d3d11renderimagecontext.bmx
glrenderimage.bmx
glrenderimagecontext.bmx
renderimage.bmx
renderimagecontextinterface.bmx
renderimageinterface.bmx

Where do I will need to put these files? (There is not explanation about these).

The instructions still are incomplete. Even with this you have said, which I am already did (I placed the only 1 file and I recompiled whole brl) it didn't help.


When we say about instructions we mean complete step by step instructions for people to follow them. You have build the mod but doesn't means other people will able to build it. Or ship a prebuilt version of the mod and tell the people where to put the files exactly.


TomToad

From what I can tell, you put all the files in the same folder as your program, except for the d3d9max2d.bmx file. I don't think it is suppose to be a module, but a regular import as the Import "renderimage.bmx" line in the example files would suggest.

Module imports are in the format Import module.file with no quote marks, no file extensions, and path to the module separated by dot.
------------------------------------------------
8 rabbits equals 1 rabbyte.

takis76

I downloaded the source files of the Brycey's new BMK.
I tried to compile the bmk.bmk and the follow errors appeared asking to have
the make.bmk , core.bmk , config.bmk and custom.bmk in the BlitzMax\bin directory. (fortunately the Blide inform me about this no one inform me where to put these files because there are no clear instructions).

I copied and these files too.
The compilation dropped another error: Cannot find a valid GCC compiler. Please check your paths and environment
I suppose to have installed my MinGW compiler before and my environment variables and path are already set. Which means it needs a different version of GCC and MinGW. Which version needs?
I have the 3.4.2 Do I need some newer?

takis76

Quote
From what I can tell, you put all the files in the same folder as your program, except for the d3d9max2d.bmx file. I don't think it is suppose to be a module, but a regular import as the Import "renderimage.bmx" line in the example files would suggest.
Module imports are in the format Import module.file with no quote marks, no file extensions, and path to the module separated by dot.

The Render2Texture Examples have all the necessary files in the same folder.


col

To test this situation I've just installed the build environment from scratch onto a Windows drive that had nothing on it what-so-ever - a 'first time installation'.

These are the instructions of exactly what I did :-

Download BlitzMax1.50 for Windows from https://nitrologic.itch.io/blitzmax and installed into the default suggested folder.
Downloaded MinGW from http://www.blide.org/backup/MinGW.rar. I followed the post at https://www.syntaxbomb.com/index.php?topic=36.0 on what needs to be done to set up the environment variable(s) that MinGW needs. This bit can sometimes trip some folks up... so the folder structure after install MinGW is something like this:-
C:\MinGW\bin
C:\MinGW\doc
C:\MinGW\include
[... etc ...]

I then downloaded the srs.mod module from https://github.com/davecamp/srs.mod, extracted it into the BlitzMax install folder as per the instructions in the readme.md at that repo.
I downloaded the RenderToTexture code from https://github.com/davecamp/Render2Texture and extracted that to the desktop.
I renamed the original file at BlitzMaxInstallFolder/mod/brl.mod/dxgraphics.mod/d3d9graphics.bmx to d3d9graphics.bmx.old. I then moved the modified d3d9graphics.bmx file out of the Render2Texture folder into the /mod/brl.mod/dxgraphics.mod/ folder to replace the original d3d9graphics.bmx file.

I opened the Render2Texture folder on the desktop and double clicked the Example1.bmx file. This opened the BlitzMax MaxIDE editor for the first time. It asked to rebuild the documentation - I clicked Yes. I then hit CTRL+D to 'Build Modules'. The build process detected the newer d3d9graphics.bmx adjustments and the srs.mod module and compiled the following files...

d3d9graphics.bmx
dxgraphics.bmx
d3d7max2d.bmx
d3d9max2d.bmx
dxgi.bmx
DXGI_brl.bmx
d3dcommon.bmx
d3dcommon_brl.bmx
d3d11.bmx
d3d11_brl.bmx
d3dcompiler.bmx
d3dcompiler_brl.bmx
d3d11shader_brl.bmx
directx11.bmx
DeviceModeSettings.c
d3d11graphics_brl.bmx
d3d11graphics.bmx
d3d11max2d_brl.bmx
d3d11max2d.bmx

Once that had finished its business, and while still in the MaxIDE editor ( which has Example1.bmx from the Render2Texture archive ) I hit compile and the example compiled and run without fault.

This is all using the standard default installation installed from scratch. No need for anything extra to get everything up and running. I would only add features/editors/build-enhancements after you can get the above working.

Oh yeah... I've updated the readme.md as per your suggestion - Thanks :)
https://github.com/davecamp

"When you observe the world through social media, you lose your faith in it."

takis76

Ok, I followed your nice instructions and this Render2Texture mod was run.

I am happy and my other mods:

Marcus Trisdale - ifsoGUI
Koriolis - Zipstream
Gman - Zipengiene

compiled well.
I will save these nice instructions.


takis76

Do you have nice detailed instructions like this one, to try to install and BlitzMax-NG?

Thank you very much for all of these nice and detailed instructions.
I will write one pdf ebook with instructions about how to install the Blitzmax correctly and I will post some precompiled BlitzMax with all mods ready to run. (After I will manage to compile each of the mod correctly and I will make a collection).




Derron

Quote from: takis76 on August 18, 2018, 14:35:56
I downloaded the source files of the Brycey's new BMK.
I tried to compile the bmk.bmk and the follow errors appeared asking to have
the make.bmk , core.bmk , config.bmk and custom.bmk in the BlitzMax\bin directory. (fortunately the Blide inform me about this no one inform me where to put these files because there are no clear instructions).

This is an absolute lie!
Do you even try to think about some stuff on your own?


https://github.com/bmx-ng/bmk
scroll down - "readme.txt" is already printed on this page


Deploying BMK
-------------

The bmk executable, core.bmk and make.bmk, should be deployed in the BlitzMax/bin
folder.


You can also create a custom.bmk file in BlitzMax/bin which is used to override built-in
compiler options, such as optimisations. (see "Using custom.bmk" below)


This clearly states what to do with core.bmk and make.bmk.


Modules are for developers so the authors of the modules expect a certain knowledge about stuff - or the will to look up for (basic!) information on your own. If some code requires additional modules and you miss these modules, the compiler will blame exactly that issue.
As you did not get this issue, your initial problem was not this missing srs.mod-module package.



@ minGW
Once you installed Brucey's BMK you can have your MinGW in BlitzMax/MinGW32 or BlitzMax/MinGW64 and it automatically uses that - no need to set environment variables.


As you now got it running - have fun toying around with r2t.


bye
Ron

takis76

Quote
This is an absolute lie!
Do you even try to think about some stuff on your own?

When I was trying to compile the bmk from Blide it present errors about core.bmk and I placed the core.bmk in the same directory and then it present another error about the make.bmk and every time I was placed the missing file another error was present and I put the missing files one by one and I was moving one step forwards each time until all files were in the directory but then another error presented about the environment variables and missing gcc which I used old MinGw. I have never compiled the language from scratch. I used to compile some mods only which worked with the initial version of the language I had purchased from the main website before they close it and made it opensource which after that many things stopped working and became incompatible. When the official site closed the support was disappeared. I worked with the old versions of my mods and I had the old version of MinGW too.

After the closing of the official Blitzmax site and the forums, everything became very difficult because, suddenly the forums were disappeared, the customer support disappeared, for a long period of time there weren't any forums at all. I didn't even know there is the German site of Blitzmax which you will find many things but you can't understand what they are saying. For a long time the language was disappeared and this forum wasn't exist yet. There were some cashed files from google which you were able to see the cashed version of the old forums and most of the links were dead and you were unable to ask any question, you just able to read old scattered posts which most direct to dead links.

Before the syntaxbomb forum appear, everything was lost and I thought the BlitzMax was over and was the time to leave it and learn another Language. But I didn't want to leave it. Is a very nice language. So fortunately this forum appeared and couple of other like:
http://mojolabs.nz and https://www.blitzcoder.org/forum/ and some other smaller.

So reading scattered posts from the left over forums I discovered that in Github there was the new version of BlitzMax and other updated mods. So as I am a liar and I am trying to figure out how things are working, because with these changes, updates, different versions of MinGw, different distros, many bugs and incompatibilities, I forgot to drop my Tarot cards to find out how to compile the new mods and the new version of the language.

That's why I registered here, to ask the gurus and finally upgrade my language too and compile the new incompatible mods.

:)

Derron

I told you a "liar" because you wrote that there were no clear instructions for BMK - yet there were some - on the repositories frontpage and in the modules readme.txt.

I understand that you have trouble with certain stuff and happy with finding potential help here (and in other forums).


@ module compilation
Only modules without ".c" code do not need a MinGW installation.


And now: have fun with render2texture and your project and come up with something cool.


bye
Ron

takis76

      Thank you.
      Now I am collecting all mods that can compiled at once without errors and then I will upload one huge blitzmax precompiled ready version with nice mods and my MinGW version ready. You will just download it and it will work at once. No installs, no fixes everything will be ready to create nice games  ;D

      I am not asking much. Just little help to compile all of these nice libraries. If we will produce a nice ready made Blitzmax working out of the box version, this will give lot of new life in to the language and more developers without knowledge and hassle to compile it will be attracted and this forum will become bigger and richer and more nice games will be developed and this language will become very popular.

      I haven't tested all examples but the mods that have compiled without error so far:


      • Bah
      • - Bass
      • - Bass FX
      • - Box2D
      • Brl
      • Gman
      • - Zip Engine
      • ifsoGUI
      • Koriolis
      • - Buffered Stream
      • - Zip Stream
      • MaxGUI
      • Patson
      • - Mpeg
      • - OggTheora
      • - yuv
      • Pub
      • Srs
      • - Directx11
      • - Shader Framework

      • Wx gadgets
      -> There still an issue with wxrarinputstream mod (I copied my precompiled version from my old MinGW) I don't know if it will work.

    The package have these so far. (I will collect all necessary mods to able to create a nice 2D and 3D game out of the box).

fielder

Wow can anyone provide "pre-compiled" binaries/mod for Windows? (i'm using minGW for other purposes and i don't want to change my current configuration to make it works with Bmax .. i already compiled my custom Mods time ago' )

very thank you!