Fast Extend library — Thread 2

Blitz3D Forums/Blitz3D Userlibs/Fast Extend library — Thread 2

MikhailV(Posted 2008) [#1]
Continuation of discussion...


I don't think it is impossible to do the same bloom using FastExtend. Actually, it would be to properly port the bloom over from AShadow to only use FastExtend which is the task at hand. And, I don't know yet if fast Extend has all the tools to copy the behaviour of the bloom of AShadow, but I will look into it. The bloom that MickhailV programmed and gave as example for post process effect couple weeks back is halfway to the same bloom done in AShadow.



Ok, ok... When there will be a free time I shall make a clone of effects (DOF and Bloom) from AShadow and build in FastExt.


miez(Posted 2008) [#2]
Yay! Especially Bloom would be awesome...


Uber Jase(Posted 2008) [#3]
I would prefer adjustable AA but bloom is cool:)


_33(Posted 2008) [#4]
I managed to fix some incompatibilities between AShadow and Fast Extend. Only the AShadow water remains incompatible, because of the following AShadow function:

Function CreateTextureRT(texW, texH, Zbuffer=0, flag=1+256)


This function holds the following incompatible instruction:
NewRenderTarget =BBCreateRenderTarget ( PeekInt(TextureBuffer(tex),12), texW, texH, Zbuffer )

The function creates a texture "tex" with supplied flags using CreateTexture, then does the following BBCreateRenderTarget, then changes a couple of bytes in the texture space supplying NewRenderTarget handle twice at displacement +12 and +16, and changing other stuff at +92 (texW) +96 (texH) and +56 (inserts value 812).

If it would be possible to have an equivalent function in Fast Extend, maybe I haven't found it yet.


Tab(Posted 2008) [#5]
Ok, ok... When there will be a free time I shall make a clone of effects (DOF and Bloom) from AShadow and build in FastExt.

If you can make it with the same or more performance, Ashadow will die in my current project. D:


Naughty Alien(Posted 2008) [#6]
as mr. Tab said..main reason why i keep using Ashadow is really fast execution of mentioned VFX..so far nothing beats it, but if Fastextend can do it at least same speed wise, i will be glad to delete Ashadow from my HD.


_33(Posted 2008) [#7]
So, MikhailV has vanished or what? I tought he'd be here more often than this. I remember when fastText and FastImage got developped, he'd pop in here every day posting a new version of his wonderful libs.


MikhailV(Posted 2008) [#8]
@_33: Dot't take offence. Truth, much little free time... I work 12-14 hours in day, no power to sit for computer after working. Slowly, but I make post-process Fx system


_33(Posted 2008) [#9]
Ah the man! Don't break yourself! It's always cool to hear from you.


Gabriele(Posted 2008) [#10]
I have download trial version and, when try run any exemple, i get all times the message "Function XXX not found"...whi include extensions not work?
Ty


_33(Posted 2008) [#11]
copy the dll and the decls in your c:/program files/blitz3d/userlibs


Gabriele(Posted 2008) [#12]
Ty


Xaron(Posted 2008) [#13]
That's great stuff, Mikhail! I think I'll buy it! :)

Cпасибо!

Xaron


El Gigante de Yeso(Posted 2008) [#14]
Yo, people. I've made a simple implementation of both DOF and Glow, using the Glow example as reference. It uses both FastImage, FastExtends and a Blitz3D extends DLL I had laying somewhere in my HD (probably an old version of Billp's DLL). I've also used CyberHeater method for project a point from screen space to world space.



Even though the library is called FastEffects, the library itself isn't very fast (about 50% slower than AShadow with both effects working), as I couldn't think of better methods for the blur, but it works and serves as substitute of AShadow functions until Mikhail releases something faster :) I used that name just for following the naming schemes of Mikhail libs xD



Example:


And here, press here for a compiled test with the effects working :3


_33(Posted 2008) [#15]
Looks really great! I'll try to understand it.

EDIT: Something I would like to try someday, or if you have the patience, it's to create a blur effects. I bet it's relatively easy, based on the DOF example you got in your lib. I called it the Fast Post Process lib myself, even if it has only two effects. In the case of blur, a good example is a speeding car. When the car goes real fast, you need to have the blur going at various degrees based on the car's speed. I use that myself in my game dev from the AShadow lib. It does great things to simulate the fact that the eye can't see all the detail because the movement is too fast (for example).

Cheers!


MikhailV(Posted 2008) [#16]
All greetings! This week there will be a update for FastExtension library. As I promised, have added postprocess effects, they work very quickly (it is impossible to make more quickly). Cut from include file:
CustomPostprocessDOF% (near#=10.0, far#=100.0, direction%=1, level%=3, blurRadius#=0.35, quality%=1)
CustomPostprocessGlow% (alpha#=1.0, darkPass%=2, blurPass%=4, blurRadius#=0.35, quality%=1, RedMultiplier%=255, GreenMultiplier%=255, BlueMultiplier%=255, alphaTexture%=0)
CustomPostprocessBlur% (alpha#=1.0, blurPass%=4, blurRadius#=0.35, quality%=1, RedMultiplier%=255, GreenMultiplier%=255, BlueMultiplier%=255, alphaTexture%=0)
CustomPostprocessInverse% (alpha#=1.0, RedMultiplier%=255, GreenMultiplier%=255, BlueMultiplier%=255, alphaTexture%=0)
CustomPostprocessGrayscale% (alpha#=1.0, brightness#=1.0, inverse%=0, alphaTexture%=0)
CustomPostprocessContrast% (alpha#=1.0, method%=0, RedMultiplier%=255, GreenMultiplier%=255, BlueMultiplier%=255, alphaTexture%=0)
CustomPostprocessBlurDirectional% (angle#=0, alpha#=1, blurPass%=4, blurRadius#=0.35, quality%=1, red%=255, green%=255, blue%=255, alphaTexture%=0)
CustomPostprocessBlurZoom% (x#=0.5, y#=0.5, zoomFactor#=105, alpha#=1, blurPass%=4, quality%=1, red%=255, green%=255, blue%=255, alphaTexture%=0)
CustomPostprocessBlurSpin% (x#=0.5, y#=0.5, spinAngle#=4, alpha#=1, blurPass%=4, quality%=1, red%=255, green%=255, blue%=255, alphaTexture%=0)



nrasool(Posted 2008) [#17]
Hey MikhailV, ooo this looks interesting, can't wait for the update. I take it, you will also have examples showing off this new features :)

Well done and keep up the hard work, the libraries are a godsend :)


MikhailV(Posted 2008) [#18]
Heh, ok :)

It is small modest demonstration of all effects. In each effect it is a lot of adjustments also it is possible to create many versions of effect — is difficultly to show All opportunities in a small example...

http://www.fastlibs.com/temp/postprocess.zip ( press F1 key for help in example )


Tab(Posted 2008) [#19]
WOW, looks great.

Thanks MikhailV :D


El Gigante de Yeso(Posted 2008) [#20]
Ultra awesome Mikhail :D! May I ask how you could do the blurring so fast? Also, I've thought of another thing: can't you use the texture mapping projection algorithm you use right now, for calculating the second set of UVs, and use those for shadow mapping? It would be a simple matter of just storing the calculated UVs, wouldn't it? :e


Tab(Posted 2008) [#21]
@El Gigante de Yeso

http://www.blitzbasic.com/Community/posts.php?topic=77919

I have a new version without the 90° limitation or any other... but the basic idea is there.

Maybe MikhailV can make it better.


MikhailV(Posted 2008) [#22]
Fast blurring - It is the big secret! A joke :)
I render a texture in itself.
About UVs: Half of NVidia videocards generates a wrong vector (XYWZ instead of XYZW)! The simple flat projection can be made, even when a vector incorrect, but to make correct 3D a projection (for shadows) is impossible. It will not work on many NVidia videocards :( Conclusion: without shaders it is impossible to make fast hardware projective shadows... It is complex to explain in detail, I badly know English.


nrasool(Posted 2008) [#23]
Ahh MikhailV, that example demo is brilliant, that is all that is needed. Can't wait for this new release now :)


_33(Posted 2008) [#24]
MikhailV, I suppose it's normal if it says "trial" every few minutes on the example. Great Post Process additions!!! This puts the last nail in the coffin for AShadow on my part! Absolutely fantastic PProcess effects, and absolutely fast :)

Also, with the Bloom, will it be possible to create superbright blooms?

Excellent work MikhailV! Just love the level of quality you put in your libs :)


miez(Posted 2008) [#25]
Totally awesome! just what I've been waiting for...


Naughty Alien(Posted 2008) [#26]
..whoaaaaa..thats what i was looking for...bye bye Ashadow...great man...when we can see downloadable updated lib??


Loktar(Posted 2008) [#27]
Want.... need..... now.... ....Please :)


Naughty Alien(Posted 2008) [#28]
..hey Mikhail..is it FastExt with this nice added features, ready for download? :)


boomboom(Posted 2008) [#29]
Hi, I found an error with DOF, and the any of the other effects that I have enabled (they are all enabled in this shot, but does the same with them individually enabled). No problem with the blur effects:




MikhailV(Posted 2008) [#30]
Greetings people!
Now you can download new FastExtension 1.12 Beta from www.fastlibs.com and test it! Also accessible version without an pop-up window, check your personal account.

@boomboom:
Thanks, I shall try to correct it to release of library!


Naughty Alien(Posted 2008) [#31]
..excellent man...Iluv ya :).. by the way...Mikhail, i have decided to buy rest of your libs since support is excellent...just one question before purchase...all of your libs are compatible and no collision between them if i use them all at same time in same program??


Mortiis(Posted 2008) [#32]
It's the best FX library for Blitz3D ever in my opinion. Congrats Mikhail.


_33(Posted 2008) [#33]
Best libs by far. Haven't tried Particle Candy and sprite candy yet, or Swift's Shadow system but they seem good as well...

But the Fast libs mature well, like a good wine. Two tumbs up ;)


MikhailV(Posted 2008) [#34]
@Naughty Alien: Yes, all my (FastExtension, FastImage, FastText) libs are compatible and no collision between them if you use them all at same time in same program! This was planned when making. Do not forget about discount coupon before buy.

@Mortiis: Thanks!

I want to define more precisely about restrictions of the use to functions RenderPostprocess:
1. Function render all postprocess effects to BackBuffer without any restrictions.
2. You can render postprocess effects to TextureBuffer for texture created with flags = 256+FE_RENDER only (exclusive of DepthOfField) !
3. DepthOfField effect can be rendered in TextureBuffer of the texture, created with flag 256+FE_ZRENDER and having width=GraphicsWidth and height=GraphicsHeight()

This will is added in help file to release version 1.12 of the FastExt library.


_33(Posted 2008) [#35]
Again, big thumbs up to the work done on the Post Process! Massive thanks!!!

BTW, I get the same bug as boomboom with the B&W on the main ALL effects demo posted here (what is close is color, what is far is B&W).


MikhailV(Posted 2008) [#36]
About boomboom bug: I have already fix this bug, tomorrow locate on site updated version (1.12 beta 2) for testing :)


_33(Posted 2008) [#37]
A more personnal question for you Mikhail, I need to know, do you think you can make for near (or far) future, a CSG library for Blitz3D geometry models? Like FastCSG library or something? This might be out of your league, I do not know, but it would be incredibly useful for me and possibly others! Then we can make our own map editors!!!

Cheers :)


Mortiis(Posted 2008) [#38]
Where can I find the product license?
I want to learn the trial restrictions and the possibilities of the Retail.


_33(Posted 2008) [#39]
The trial comes bundled with pop up screens saying it is a trial :P
Otherwise, there are no restrictions (if I'm not mistaken). If you use the Blitz user rebate coupon, you pay very little for the bundle of 3 good plugins.


Mortiis(Posted 2008) [#40]
Hmm, I can't see any pop-up screens when I run the samples coming with the download.


Tab(Posted 2008) [#41]
@Mortiis
The pop-up appears every 3 minutes or something like that.


The glow FX is amazing. Thank you once again MikhailV.


MikhailV(Posted 2008) [#42]
@_33: About CSG - excuse me, but I tell - no. It is not interest and it is very difficult...

@_Mortiis: About license (briefly):
1. You can use libraries in ALL your applications (commercial, games and etc.)
2. You can redistribute DLL file only with your application and with small sub-license file - it is obligatory.
3. All other files included in archive may not be redistributed.

:)


Naughty Alien(Posted 2008) [#43]
>>@Naughty Alien: Yes, all my (FastExtension, FastImage, FastText) libs are compatible and no collision between them if you use them all at same time in same program! This was planned when making. Do not forget about discount coupon before buy.<<

Mikhail..I do have licensed FastExt lib..but Im planing to buy all rest libs you have..so since I have one already, is discount available if i buy rest of them (what means not whole apckage since I have one lib already)?


Tab(Posted 2008) [#44]
I found an bug I think... The texture flag 16&32 don't work anymore ( on any texture in the code ) when the postprocess is enable.


MikhailV(Posted 2008) [#45]
@Tab: Thanks, I shall check it and fix...

@Naughty Alien: Excuse me, but there is only one discount coupon. You can buy other libraries using this coupon. There are no other variants.


Tab(Posted 2008) [#46]
Ok...

Here a comparative image of Ashadow Glow vs FastExt Glow.


FastExt = 499 FPS - aShadow = 629 FPS

The real problem is when i put the Fastext Glow in my game, aShadow don't HIT my performance ( With 330~450 FPS / Without 400~650 )... But Fastext in the same scene down my performance to 170~200 FPS.

I like the Fastext Postprocess... but the performance is a problem. Maybe more options to lower the quality can help... i don't know, i hope MikhailV can do something.

Anyway, FastExt gives a great visual quality.

Spec -> NV 8800GT - Pentium D 2.8 - Win Vista


Naughty Alien(Posted 2008) [#47]
..aha..okay..never mind..im going to buy this nice libs...by the way, any chance that you going to include stencil shadow system, or maybe shadow mapping?? That would be GREAT..


MikhailV(Posted 2008) [#48]
@Tab: You can increase performance with next methods:

1. You can modify include file FastExt.bb and set more small size for postprocess texture:
; find original code (in function InitPostprocess%() )
FE_PostprocessTexture2 = CreateTexture ( GraphicsWidth()/3, GraphicsHeight()/3, 1 + 256 + FE_ExSIZE  + FE_RENDER )
...
FE_PostprocessTexture4 = CreateTexture ( GraphicsWidth()/3, GraphicsHeight()/3, 1 + 256 + FE_ExSIZE  + FE_RENDER )

; And change size for textures (or less):
FE_PostprocessTexture2 = CreateTexture ( GraphicsWidth()/4, GraphicsHeight()/4, 1 + 256 + FE_ExSIZE  + FE_RENDER )
...
FE_PostprocessTexture4 = CreateTexture ( GraphicsWidth()/4, GraphicsHeight()/4, 1 + 256 + FE_ExSIZE  + FE_RENDER )


2. You can set smaller quantity of passes for parameters darkPasses% & blurPasses% in function CustomPostprocessGlow%

3. Also you can set LOW quality in parametr quality% in function CustomPostprocessGlow% (set quality%=0)

But all depends on the size of postprocess textures!


MikhailV(Posted 2008) [#49]
@Naughty Alien: It can be, but I not promise... ;)


Naughty Alien(Posted 2008) [#50]
..ahh..cmon mannn...shadowmapping..shadowmapping..ahh..cmonn :)


Mortiis(Posted 2008) [#51]
I may sound like an idiot but, where do I get my coupon code from?


MikhailV(Posted 2008) [#52]
@Mortiis: coupon - 50blitzersoff :)


Tab(Posted 2008) [#53]
@MikhailV
I'm trying with your tips, but i can't make it work not even close to the performance of aShadow.

aShadow don't want to die. >_>


MikhailV(Posted 2008) [#54]

aShadow don't want to die


:D

Give me time, I shall find the best solution...

ps. I have looked AShadow source code, it cannot work more quickly, it's impossible :D
All right, I shall try to make analogue and to check up in practice!


Tab(Posted 2008) [#55]
ps. I have looked AShadow source code, it cannot work more quickly, it's impossible :D
All right, I shall try to make analogue and to check up in practice!

aShadow make some type of magic trick to win performance...

I hope you can beat.


Naughty Alien(Posted 2008) [#56]
I have tested now..FastExt is faster regarding water reflection/refraction rendering than Ashadow, plus there is no Zorder problems like Ashadow has..


boomboom(Posted 2008) [#57]
You know you want to make a FastShadow system next :D


Naughty Alien(Posted 2008) [#58]
Shadowmaps should be next feature...mann..imagine that...just set it up, size and violaa..all shadows real time :)..then imagine exported GI maps from 3dsmax and blended on to geometry, and over it shadowmaps....perfeccttt


MikhailV(Posted 2008) [#59]
Shadows, shadows... Heh...
I shall think. I wait serious project, I must realize library v1.12 and come to do project. And only shall afterwards think about shadows.


MikhailV(Posted 2008) [#60]
@Tab:
About postprocess effects and flags 16 & 32 for texture - all work fine, I test it:

Glow and textures with 16 & 32 flags (click image for zoom)


And example code: http://www.fastlibs.com/temp/flags_16_32.bb (download and place this file beside other examples -> run)


And below a comparative images of Ashadow Glow (Native example from AShadow library archive) vs FastExt Glow:
I'm draw only Fps text, disable light-rotation and has insert alike Fps-counter in both examples!

AShadow (click image for zoom)


FastExt (click image for zoom)


Spec -> NVidia 8600 GT - AMD 2.6 - Win XP

That will say?
I can do (specially for you) Glow mode - an full analogue of the algorithm from AShadow lib. Need to spend time for this mode, you certain? Can you mistaken?


Mortiis(Posted 2008) [#61]
It may be a driver or graphics card issue. Can you compile both of that examples and we can try them. Cause I don't have aShadow.

By the way, I'll buy your libs as soon as possible (a little broke right now, being a student is hard). %50 discount is very generous!


_33(Posted 2008) [#62]
The 3 libs with the rebate coupon is 30$ total ;) for the Blitzers. I think it's a great price for the complete fast libs.

EDIT: Concerning the water system of Fast Extend, I am a bit disapointed thoe. I find it difficult to implement. I am having many problems.
- The camera view is in a 1024x1024 window on my selected screen resolution of 1600x1200
- There is a fog over the water that fades everything to white in the background
- There is no fog underwater
- The water doesn't have a color
- Can't find a way to properly animate the water movement
- The water is simply black like ink. How can I make it more like blue?

That's the prob I have with this water system. The water in AShadow was right from the start. The implementation wasn't easy but it worked really well. That is my current gripe with Fast Extend library. Why is the water system using a 3DS file for the water mesh?


Tab(Posted 2008) [#63]
About postprocess effects and flags 16 & 32 for texture - all work fine, I test it:

Ok... the problem appears only when I move the camera in certain angles... When I turn off the postprocess the bug disappear.

The flag 16+32 is active in both images.


I can do (specially for you) Glow mode - an full analogue of the algorithm from AShadow lib. Need to spend time for this mode, you certain? Can you mistaken?

aShadow is faster in MY PC, i'm 100% sure about that.

Here is the aShadow config on my example.. ( Maybe this can help )
Ref_Glow_DarkPower=3
Ref_Glow_BlurPower=2
Ref_BlSprAlpha#=.2
Ref_CountBlSpr#=6
CreateGlow Camera, 512, 512 ,.35,.5


Maybe is a issue with my VGA/Drives like Mortiis says, but is just a maybe. If you can, send me the special version to test it. ^_^

Thanks MikhailV.

@_33
- There is no fog underwater

HideEntity WPhys\MeshWater

TMP_AjusFogMin# = EntityY(Main_Camara) + 13.5
TMP_AjusFogMax# = TMP_AjusFogMin + 15
CameraFogMode Main_Camara,1
CameraClsColor Main_Camara,154,204,207
CameraFogColor Main_Camara,154,204,207
CameraFogRange Main_Camara, TMP_AjusFogMin,TMP_AjusFogMax
CameraRange( Main_Camara, 1, TMP_AjusFogMax )

ShowClipplane WaterClipplane
AlignClipplane WaterClipplane, WPhys\PivoteClip

SetBuffer TextureBuffer(ReflectTexture)

RenderWorld()

HideClipplane WaterClipplane

EntityTexture WPhys\WaterFX, ReflectTexture, 0, 2
ShowEntity WPhys\MeshWater

SetBuffer BackBuffer()



Naughty Alien(Posted 2008) [#64]
@_33
I dont know what you did, but I manage to get it all working fine, underwater fog or whatever, reflection or refraction, transparency, color, etc..you name it..and its working just fine (I have 'pack' it all in to ne nice function, and just one simple call per water :))


Naughty Alien(Posted 2008) [#65]
here it is in action..no problem at all, custom shape, refraction/reflection in one line call..its my level I previously post in showcase, but this time updated with some vegetation, grass and water and some vfx..FastExt..




_33(Posted 2008) [#66]
Thanks Naughty Alien I'll have to investigate more. I'm not saying the system doesn't work, just that I haven't figured it out much. But like you I have a Water_Init and Water_Update type of function.


MikhailV(Posted 2008) [#67]
@Tab:
About flags 16 & 32: Îê, I have understood you and have checked up - you are right, I shall fix a bug, please wait...
About Glow: I shall do a special Glow mode - a clone of algorithm of AShadow lib.

@_33: I specially not made is ready-solution for water - as universal cannot be fast! Closely look examples of water from lib archive. The main thing to understand a principle. You can do any adjustments of the camera for a underwater stage. The main thing to understand, then you can make everything!

@Naughty Alien: Great picture, my respect for you!

For all: I suggest to measure speed of Glow-effect on your computers (FastExt and AShadow at basic adjustments) - http://www.fastlibs.com/temp/glow_demos.zip

My FPS results (NVidia 8600 GT - AMD 2.6 - Win XP):
FastExt - 502
AShadow - 453

And other computer (ATI X700 - P4 3.0 - WinXP):
FastExt - 404
AShadow - 347


MikhailV(Posted 2008) [#68]
Other comps on my work:

NVidia 8500 GT - P4 2Core 1.86 - WinXP
AShadow - 367
FastExt - 405

NVidia 7600 GT - P4 2Core 1.86 - WinXp
AShadow - 778
FastExt - 725 ( more slow, with strange pixelate effect :( )


Tab(Posted 2008) [#69]
Here my test on my others PC's.

ATI Radeon 9550 - Athlon XP 2600+ - Win XP
AShadow - 158 ~ 160
FastExt - 158 ~ 164

NV FX5700 - Athlon 64 3200+ - Win XP
AShadow - 172 ~ 173
FastExt - 150 ~ 151

NV 8800GT - Pentium D 2.8MHZ - Win Vista
AShadow - 600 ~ 620 ( strange pixelate effect... D: )
FastExt - 490 ~ 505

I don't know why the pixelate effect on Ashadow... To check the problem, I compiled the example with my version of Ashadow (1.0.9.5) and run at 638 ~ 645 ( 8800GT ), works faster and without any pixelate effect.

Here my compiled example -> http://www.badmouse.cl/dev/aShadowTabVer.rar

In the others cases the difference is very small.

Hmm...


MikhailV(Posted 2008) [#70]
Thanks! I run your version - results same as well as earlier (look the previous posts). Pixelate effect in FastExt on NVidia 7600 GT ONLY, not AShadow.

p.s. Repeatedly: I shall do a special Glow mode - a clone of algorithm of AShadow lib. Wait... :)


Naughty Alien(Posted 2008) [#71]
Ashadow doesnt work on Vista at all...fastExt working just fine..


Tab(Posted 2008) [#72]
Pixelate effect in FastExt on NVidia 7600 GT ONLY, not AShadow.

In my case I have the pixelate bug on your example of aShadow. FastExt works fine.

Anyway is only a strange problem, nothing important. =)


Ashadow doesnt work on Vista at all...fastExt working just fine..

In my tests, Ashadow only have problems with the shadows running on Vista.


Naughty Alien(Posted 2008) [#73]
..on my Vista rig, everything i try with Ashadow, stuck or cant run at all..


Tab(Posted 2008) [#74]
..on my Vista rig, everything i try with Ashadow, stuck or cant run at all..

Sounds bad, more reasons to help MikhailV with his lib.

I don't want problems with the compatibility of my game.


Another Test.

NV 8800 GTX - Core 2 Quad 2.40Ghz - Win XP
Ashadow - 1359
FastExt - 1635

Here FastExt wins... Hmm... maybe the performance problem is Win Vista? o_o


MikhailV(Posted 2008) [#75]
May be test it in fullscreen on Vista (exclusive mode for application)?


Tab(Posted 2008) [#76]
Fullscreen on Win Vista...

NV 8800GT - Pentium D 2.8MHZ
Ashadow - 736 ~ 752
FastExt - 569 ~ 575

More frames, but the same result.


Tab(Posted 2008) [#77]
I'm testing the others libs from your site, and all my tests give a poor performance. :S

FastText is slower than BlitzText and FastImage the same thing.

Example :


Something is wrong, I'm going to install Win XP in my PC to see what happen... Maybe some function on the FastLibs core have a problem with Vista?


El Gigante de Yeso(Posted 2008) [#78]
@NaughtyAlien: Awesome screenshot, very professional looking! :D

@Milkhail
I've used AShadow in Vista aswell, and that "pixelation" appears on my end aswell. It works well on XP, though.

AShadow: ~1153 fps
FastExt: ~780 fps

My computer specs are:
- AMD Phenom 9550 @ 2.2Ghz each core
- Asus M3A
- 4gb DDR2 @ 800Mhz
- Geforce 8800GT 512GDDR3
- Running on Windows Vista x64

I also have some issues with water aswell, but my problems are different. As I get far from the world origin point, the water plane starts to show artifacts, badly. I'll upload a compiled version of the test to show you what I mean.

Edit: Daaamn. Just tested out in XP, and it seems to be a Vista only problem. Silly Microsoft engineers.


MikhailV(Posted 2008) [#79]
@Tab: About FastText - this problem was already discussed (in FastText topic), and FastText slower on Vista because there other algorithm (modified GDI) of display of the text... It is not terrible, even the minimal loss in speed is overlapped by advantages (antialising, Unicode support, rotation and etc.). On XP results: 2-3 msek! If you are not required Unicode - you can use to DrawText function from FastImage library to receive high speed not dependent on the size of a font and OS.

@for all: DirectX7 on OS Vista is completely emulated through DirectX9! The emulator cannot be ideal and reproduce all precisely :) It is not surprising, that the emulator works more slowly.
I do not use OS Vista and I can not guarantee high speed on this system.

p.s. It is very a pity, that the Blitz3D on the basis of DirectX7, instead of DirectX8. There would be no problems.


El Gigante de Yeso(Posted 2008) [#80]
One thing is slowly, and another having horrible artifacts for the water :3


Naughty Alien(Posted 2008) [#81]
@ El Gigante de Yeso...
artefacts can be caused because your water clipping plane is out of position..instead, try to get your water surface mesh with findchild and then align clip plane pivot based on that entity and it will work just fine..


El Gigante de Yeso(Posted 2008) [#82]
Edit: After some testings, it's the clipping pivot what's messing up the whole scene. More specifically, the ClipPivotUp.
Edit2: It was a precission issue all along. After changing the ClipPivotUp position, the artifacts disappeared. It's strange how the precission errors show up on Vista, and not on XP.

So, if anyone's having problems with artifacts showing up, it's the ClipPivotUp XD Thank you, Naughty Alien :)


_33(Posted 2008) [#83]
I need to make the water look like this:
http://www.blitzbasic.com/gallery/view_pic.php?id=1586&gallery=&page=14
http://www.blitzbasic.com/gallery/view_pic.php?id=1588&gallery=&page=14

EDIT: I'll try to have this done during the weekend and post screenies.


Naughty Alien(Posted 2008) [#84]
..its not a problem..you can do few things..generate new animation sequence and not use default one or use 2 non animated textures, tilable and positiontexture them in opposite directions with different speed and apply reflection/refraction on to them and adjust scale factor..thats what you have to do with ashadow too in order to achieve that..


Tab(Posted 2008) [#85]
Ok.. then FastLibs don't works well on Vista... T_T

you can use to DrawText function from FastImage library to receive high speed not dependent on the size of a font and OS.

I tested in my editor and the problem is +/- the same, BlitzText is faster than FastImage when the text quantity is small. ( Showing info like fps, tris, phys time, particle quantity )


El Gigante de Yeso(Posted 2008) [#86]
Hmmm, what Tab says about FastText is true (both FastText and BlitzText work about at the same speed), but FastImage works way faster than BlitzText on my end. And FastExtensions works quite fast aswell.

Thing is I have the same card as you, so there should be another external factor to that slowness.


Hotshot2005(Posted 2008) [#87]
VERY NICE PICTURE Naught Alien :)


_33(Posted 2008) [#88]
On the call CustomPostprocessGrayscale, the example FastExt_PostprocessGrayscale.bb refers to the 3rd paramater as Method, but on other occasions, it is referred to as Inverse.
On the call CustomPostprocessBlurDirectional, the example FastExt_PostprocessAll.bb refers to the 4th parameter as distance, and other places it refers to it as radius.

I get a "Memory access violation" when calling CustomPostprocessGlow%() with following values:
alpha = 0.622513
darkpasses = 2
blurpasses = 4
blurradius = 0.377487
quality = 0
red = 255
green = 255
blue = 255
alphatexture = 1


Concerning the glow of Fast Extend vs the one of AShadow. To me it is now much clearer that what we want is not Glow to be like the one of AShadow, but to have a BLOOM pp effect as well. BLOOM is much more appropriate as it is the effects that creates a flood fill of colors or whites on the image.

Explained here: http://en.wikipedia.org/wiki/Bloom_(shader_effect)

Quick question: If I want to have glow applied on FastImage 2D stuff, normally should it work? I have tried and nothing there seems to happen. It doesn't seem to work on 2D FastImage. This used to work with AShadow :(

A pixelation effect also would be very appreciated :P

EDIT: I think for the crash I had, the problem is alphatexture = 1. What is it used for?


MikhailV(Posted 2008) [#89]
@_33:
— Warning! AlphaTexture - it's not number! it's real texture loaded with LoadTexture (or CreateTexture) function with alpha-channel ! See examples and read help file!
— And for Bloom - set darkpasses = 0 or darkpasses = 1, set blurpasses 5...7, increase blurradius (<- this is most main) and quality=1 for more quality for effect.
— You can apply effect for 2D, call RenderPostprocess after all 2D drawing functions (after EndDraw in FastImage).

@Tab:

... BlitzText is faster than FastImage when the text quantity is small


NOT FastImage, you mistaken! You speak about FastText only!
— Don't panick. About FastText - I have explained above. It is impossible draw a conclusion text quicker on OS Vista. Use FastImage for text drawing.
— I have done for you special modes in effect Glow. You can set quality% = 2 or 3 (see help file) and test it (other params set like AShadow). These modes to identical AShadow, I clone algorithm. Download FastExt v1.12 beta 3 from my site.
— Also please test Glow on old modes (quality% = 0 or 1), I optimized code of the effect.
— And flags 16 & 32 bug fixed! You can to check this itself!

For All:
Available FastExtension v1.12 beta 3 from my site www.fastlibs.com [ clamp bug fixed and library is in addition optimized]


Pinete(Posted 2008) [#90]
Amazing!!!
congratulations mikhailV!!
When do you plan to do the release?

all the best!


Tab(Posted 2008) [#91]
NOT FastImage, you mistaken! You speak about FastText only!

In my PC is faster only when the text quantity is more than 15 characters.

— Also please test Glow on old modes (quality% = 0 or 1), I optimized code of the effect.

The quality 2 and 3 works slower. =(

0 - ~500 fps
1 - ~475 fps
2 - ~370 fps
3 - ~345 fps

— And flags 16 & 32 bug fixed! You can to check this itself!

Great. =)


_33(Posted 2008) [#92]
OK, managed to figure out the problem I had with 2D and PP effects, now works fine!!! I found a way to make the effects trail and overbright like you can do on analog consoles, like a flood of the image (looped signal). I would really wish for this to come bundled inside of FastExtend, but I ask for too many things sometimes ;)

Good work :)

EDIT: I absolutely love the Blur effect, which I find the BEST one in the PP series you have in there, but I find the Glow very weak. It should let me do flood glow and make things overbright, but it doesn't. So, I have to use a combination of Glow and another effect to get what I need, which is a shame. but it is still very good in quality none the less.

For those who need a method of applying post processing effects:


And in the main loop:
	If pproc\state > False Then
		Post_Processing_Render()
	EndIf



MikhailV(Posted 2008) [#93]
@_33:
... flood of the image (looped signal)

You can to do the screenshot? Can be I shall be able to do such a effect...


_33(Posted 2008) [#94]
Hi MikhailV,

I have a screenshot, but the place I used to upload changed and it is too complicated. But the idea is, the PP effect is like Sample&Hold. So, everything that is moving will leave trails. But they are vanishing trails basically.

EDIT: Also, I find the Contrast effect very good, specially the Method 4, which looks GREAT! But I wish it could have stronger contrast parameters! Maybe I don't understand fully how it works.

EDIT2: Also I found that using the Zoom blur by itself is not very strong effect. But using a combination of the Zoom blur and the Spin blur makes for a wicked strong Zoom effects with slight round edges, which I like a lot.


Doiron(Posted 2008) [#95]
_33: I've understood what you are looking for. Fortunely I did a demo years ago which among others shows this effect (which anyway can be adapted to Fastlibs already since the basics are there), and I just sent it to MikhailV.


_33(Posted 2008) [#96]
It's the type of effect you get when you point a videocamera towards a screen and thus create a recursive image effect.

http://youtube.com/watch?v=i8-GzVfi_x4

:) I don,t know why it's sometimes called the Droste effect ?

Or other times a feedback effect:
http://youtube.com/watch?v=LO-WBGewnrU
http://youtube.com/watch?v=sd1dqFTox80
http://youtube.com/watch?v=uAeCV2MPLIM


MikhailV(Posted 2008) [#97]
@_33: It's simple, very very simple :)



Without any postprocess!


_33(Posted 2008) [#98]
That example doesn't work here :(


MikhailV(Posted 2008) [#99]
@_33: Save & place this example beside other examples...


_33(Posted 2008) [#100]
The program runs, but it doen't do any feedback effect, just a white frame turning and zooming in and out, but no feedback.

Is this the instruction supposed to do the feedback?
	CopyRectStretch 0,0,GraphicsWidth(),GraphicsHeight(),0,0,TextureWidth(t),TextureHeight(t),BackBuffer(),TextureBuffer(t)




El Gigante de Yeso(Posted 2008) [#101]
Yeah. But there must be something wrong on your end, because it works for me. :3


_33(Posted 2008) [#102]
I'll tell you what; if it doesn't work on my machine, it won't work on many other machines, because there is nothing wrong with my machine. And nothing wrong with Blitz3D either here.


Doiron(Posted 2008) [#103]
_33: I think that your example was a bit misleading, unless you was referring to cheesy 80s effects (my impression is that you were talking about long overexposition).

MikhailV, take a look at your email!


_33(Posted 2008) [#104]
Doiron, I like all effects :D Plus I'm making a VJ software too. So, all effects are welcome :)

MikhailV: Is it something on your to do list to permit the selection of the Antialias modes. BTW the anisotropic filtering modes work fine here, thanks! Also, is it doable to set the MIPMAP mode?


MikhailV(Posted 2008) [#105]
Good news, FastExtension library v1.12 released!

Are they also added:
- classic MotionBlur effect with many adjustment
- new example FastExt_PostprocessBlurMotion.bb
- see also new example FastExt_PostprocessGlowEx.bb (for new function CustomPostprocessGlowEx with additional Glow properies)
- added BumpPower function (much wanted some people, I have added)
- and all problems fixed
- do not forget update FastExt.decls file!


MikhailV(Posted 2008) [#106]
@_33: I can not do antialias. I tried, this does not work at majority videocards... Also about Bloom effect: you can combine Glow and MotionBlur (see FastExt v1.12) - I hope this give necessary effect :)


_33(Posted 2008) [#107]
Many thanks MikhailV


Tab(Posted 2008) [#108]
The postprocess are faster than the beta version.

- added BumpPower function (much wanted some people, I have added)

Excellent.

Nice work MikhailV.


_33(Posted 2008) [#109]
MikhailV, sent U a support message.


Naughty Alien(Posted 2008) [#110]
Excellent Mikhail boy :)...what is PowerBump anyway?


_33(Posted 2008) [#111]
If only Mikhail could give me a new access code (which I have lost because of a Windows reinstall) LOL!!! I so want to have this latest version :) I got 3 projects using these libs.


Naughty Alien(Posted 2008) [#112]
this lib is absolute a MUST...practically with incorporated shadowmaps, and ability to cast receive shadows pretty much from and on to everything, including animated chars and MD2, this thingy will really makes B3D soo tasty..


_33(Posted 2008) [#113]
Does seem faster, if I'm not mistaken the pprocess is about 30% faster than 1.12b3

The GlowEx demo is absolutely earth shattering !!! The possibilities of the Glow effects are now beyond AShadow 10 folds!

EDIT: I also noticed that all the pprocess effects have their effects range increased, if I am not mistaken. This is very good.


Dreamora(Posted 2008) [#114]
For good performance on older hardware make sure that the textures are power of 2 square. Anything older than GF7 / Radeon X1300 will perform better with Square power of 2 than with non square textures. On stuff like Radeon 9000 this makes a difference of up to 50% if you have lots of textures.


Ross C(Posted 2008) [#115]
Nice info Dreamora. Nice work man. This lib is great. It SHOULD come with blitz3d retail :o)


MikhailV(Posted 2008) [#116]
Many asked, I have done demo "Wet floors and walls" — simple and fast reflections with bump. See here — http://blitzbasic.com/Community/posts.php?topic=79443


L_Draven(Posted 2008) [#117]
Hi MikhailV i clean the ashadow library from my game for use your library, good work man!!

But i have a problem and i cant find the solution, when i render the glow effect only affect to half part of the screen, check this image, any idea?

thanks in advance.





L_Draven(Posted 2008) [#118]
Ok the problem was in the water creation.

If i comment the funcion that create water with refraction and reflexion the postprocess works perfect.

Its possible have DOF,GLOW and Water with Reracft&Reflexion at same time?? how??

thanks man

PD: the problem is in the CreateClipplane function, if i comment this line the postprocess fx is working, if not, the problem in the picture that i have showed appears.


Naughty Alien(Posted 2008) [#119]
itsworking all of them at same time here just fine..however,be sure that your water clipplane is positioned properly


Naughty Alien(Posted 2008) [#120]
..Mikhail..have you considered including shadowmaps in to lib? :) that will be cool man...:)


MadJack(Posted 2008) [#121]
So from what I'm reading here, FastExt is pretty stable and runs on both XP and Vista?


Naughty Alien(Posted 2008) [#122]
..yup...stable in to extreme man ;) i really test is badly..working just fine


MadJack(Posted 2008) [#123]
NA

Cool - because I had to change the glowfx in Tank Universal to FastExt at the last minute - TomsDX7test.dll was conflicting/crashing with an overlay used by a particular portal. - so fastExt was a bit of a lifesaver.

But fastExt's glow is better in many ways - much faster than doing another render(totexture) and although it's a bit more garish, it's made the firefights more colourful again.

(By the way, that Steam wrapper Simon was working on is up and running. Don't think he's wrapped everything - but you might like to get in contact with him. I've been remiss as I've been so busy.)


Naughty Alien(Posted 2008) [#124]
..thanks..I hope it will be available(Steam wrapper) till february next year..thats my target im aiming for...


El Gigante de Yeso(Posted 2008) [#125]
L_Draven, after the post process, disable the clipping plane. Either way, the overlay geometry rendered over the screen for the post process will be clipped.


t3K|Mac(Posted 2008) [#126]
any chance to have an anti-aliasing postprocess fx?


MikhailV(Posted 2008) [#127]
About antialiasing — read skidracer comments:

http://www.blitzbasic.com/Community/posts.php?topic=71200
http://www.blitzbasic.com/Community/posts.php?topic=70694

Antialiasing in Blitz3D — is a greater problem, it is connected with DirectX7 and has no decision :(


Naughty Alien(Posted 2008) [#128]
..Mikhail...Shadowmapping, please man :) it will let us use MD2 with shadows what will be speed boost regarding animation...cmon man :)


L_Draven(Posted 2008) [#129]
i can`t do it correctly, the thing is:

First i make all the calculations for the water (reflection and refraction) then make the renderworld, then the postprocess and render postprocess and finally disable the waterclipplane (how? with a hideclipplane?)

Thanks in advance friends.


Greets


MikhailV(Posted 2008) [#130]
@L_Draven: I have checked up an source-codes and examples, clippalnes do not influence for postprocess effects... Very strange.
You can disable clipplanes before RenderPostprocess function, and enable after.


L_Draven(Posted 2008) [#131]
Thanks MikhailV finally i make it work in this exactly moment jejej touching some params that i have wrong :-(.

Thanks a million anyway friend, i will upload a image for show it then.

Thanks again.


_33(Posted 2008) [#132]
MikhailV, I got a request a propos the BlurZoom. Is it possible to have it either zoom forward, or zoom backwards. Right now it only does forward. This would really be great!

Also I noticed, that after intense usage of post process effects, that my program runs slower and slower (framerate drops). Is it possible there is a leak or something in the post processing where some stuff foesn't get cleared? Just a worry I have because of the framerate drop after 2 or 3 minutes of switching effects (I go from 60+ to 40 fps).

Cheers


MikhailV(Posted 2008) [#133]
@_33: Define zoom factor <100 - it's backward zoom. It is very similar but if closely to look, it is visible that all works correctly. From help-file:
zoomFactor# - define zoom factor in percent (100 - without zoom, >100 - zoom-out = forward, <100 - zoom-in = backwards).

About framerate: It is strange, such should not be (algorithm is always carried out equally). I shall test.


t3K|Mac(Posted 2008) [#134]
Hi MixhailV!

I recently bought your libs and changed my login/pass. Now i cannot login anymore. Could you fix that please?


_33(Posted 2008) [#135]
Thanks MikhailV for the tip on the zoom, it works perfectly for zoom backwards.

EDIT: The slowdown I got in my program is my fault! Sorry :(


MikhailV(Posted 2008) [#136]
Fine! ;)


Mortiis(Posted 2008) [#137]
Bought all the libs finally but can't download it. The link plimus gave me doesn't wok. Sent you an email with more detail. Please fix it soon. Thanks.


MikhailV(Posted 2008) [#138]
@Mortiis: Check your email ! Excuse me for the delay...


Mortiis(Posted 2008) [#139]
Ok problem solved now, thank you so much MikhailV both for solving the problem and for cheap but great libs.

Off to tinker with them now.


_33(Posted 2008) [#140]
MikhailV, I have a MAV in fastext.bb :(
Function FreeTexture% (texture%)
	If texture<>0 Then
		Return FreeTexture_ (texture, TextureBuffer(texture))
	Else
		Return 0
	EndIf
End Function

The texture is a 16x16 tile font image in video memory that I need to clear, which was created in FastImage as following:
	img% = LoadAnimTexture(fn$, 1+2+256, sx, sy, 0, 256)


The way I free it is like soo:
Function term_freefont%(font_id%)
	If font_id < 0 Or font_id >= TRM_max_fonts Then Return term_handle_return_code(TRMRC_invalid_font_id,10650100, font_id)
	If term\font[font_id]\texture > 0 Then
		term\font[font_id]\name$ = ""
		term\font[font_id]\filename$ = ""
		FreeTexture term\font[font_id]\texture
		FreeImageEx(term\font[font_id]\texture)
		term\font[font_id]\texture = 0
		FreeImageEx(term\font[font_id]\image)
		term\font[font_id]\image = 0
		FreeBank term\font[font_id]\bitdata
		term\font[font_id]\bitdata = 0
		Return TRMRC_successful
	Else
		Return term_handle_return_code(TRMRC_invalid_font_id,10650200, font_id)
	EndIf
End Function


I only use FastExt and FastImage as extra DLLs. If you need the sourcecode of my project, simply ask and I will e-mail :)


MikhailV(Posted 2008) [#141]
@_33:
Yes, I shall solve this problem (anim texture is guilty). It would be desirable a small example in which always it is visible a bug.

And what for to create the custom font-system? In FastImage library already there is a font-system, it is optimized for fastest drawing!


_33(Posted 2008) [#142]
MikhailV, I build the fonts for the terminal system internally, which is why it has it's own font management system. The example code would need to allocate the font in vmem, upload the graphics, with animated 16x16 and then clear them. from vmem again.


Barton(Posted 2008) [#143]
@MikhailV: You are the best and your support is very very good !!

Can you develop Blitz3D V2.0 for us ? :D

Very good. Now I miss a very fast Dynamic-Shadow Support in your FastLibs and I'm then happy.


Mortiis(Posted 2008) [#144]
You can use Swift's library as I do for shadow.


Naughty Alien(Posted 2008) [#145]
..nope..Swifty lib is fine, but to have shadowmaps over whole geometry would be way nicer and easier to use..


MikhailV(Posted 2008) [#146]
About shadows:

Projective shadows (shadowmaps) — it is possible to do many shadow-casters, but it is not enough shadow-receivers (eat FPS). There are no problems with animated objects. It is possible to smooth shadow (blurred).

Stencil shadows - can do many many shadow-receivers (even all meshes on level), but it is not enough shadow-casters, everyone caster demands many calculations and strains both CPU and GPU. Almost it is impossible to get information about vertices and triangles for animated objects. These shadows cannot be made soft (blurred).

Conclusion:

Good solution for projective shadows - Swift Shadow lib. There is no sense to do better than it.

Fastest solution for stencil shadows - AShadow lib, but the code is terrible and it is very complex to adapt for teamwork with other libraries, for a long time there is no support of the author :( I shall probably create stencil shadows lib in the future, in it there is a sense. But there is not enough time for this purpose.


MikhailV(Posted 2008) [#147]
@_33:

I cannot see a MAV, I do all as you have told. But I all the same shall put protection in library from animated textures.

And about your code:
term\font[font_id]\name$ = ""
term\font[font_id]\filename$ = ""
FreeTexture term\font[font_id]\texture
FreeImageEx(term\font[font_id]\texture)
term\font[font_id]\texture = 0
FreeImageEx(term\font[font_id]\image)
term\font[font_id]\image = 0
FreeBank term\font[font_id]\bitdata
term\font[font_id]\bitdata = 0

; don't use FreeImageEx with first param = texture, read help-file! FreeImageEx(term\font[font_id]\texture) - it's incorrect
; you can correct your code, see below

term\font[font_id]\name$ = ""
term\font[font_id]\filename$ = ""
FreeImageEx term\font[font_id]\image, 1  ; auto-free texture for this image
term\font[font_id]\texture = 0
term\font[font_id]\image = 0
FreeBank term\font[font_id]\bitdata
term\font[font_id]\bitdata = 0




Barton(Posted 2008) [#148]
@Mortiis: I've tested swift shadow lib but I have not solved the problem with geometry bug on some mesh objects. The lib is good for small games but my games are very complex and that is problem. Otherwise I would have used it.

But the fastlibs are very compatible with many graphic cards and very fast in rendering. I'm sure, that MikhailV can make a fast shadow lib. It is better when we initialize only one DLL for extended DX7 funtions. Otherwise there can be conflicts.

We need a revolution in shadow system. :)


_33(Posted 2008) [#149]
Thanks MikhailV for the info :) I still have the same problem thoe. Actually it does not always MAV, sometimes the program just ends without any messages. It's all related to freeing the image/texture of the fonts.


Naughty Alien(Posted 2008) [#150]
I still do believe that shadowmapping integration will be way to go (like one I saw in Xors3d) with setting up resolution and objects included in it...Swifty lib is fine but it doesnt support MD2, then, there is no selfshading, and you cant rotate receivers(i think) therefore, its not good solution for serious levels...shadowmaps will do great, because it will be all in one with some nice LOD it will be great and with included GI maps rendered out from any lightmap generation tool, in to small texture and combined with shadowmaps in real time, will be an absolute ass kicker...I will pay additional price for Fastext if have such feature(shadowmaps)...


El Gigante de Yeso(Posted 2008) [#151]
I've been doing some tests on my own, and got to do a small shadow mapping system. But then, I quickly came to the conclusion that for correctly shadowing the reciever objects, you need to access the ZBuffer (as for the actual shadows being casted on objects that are infront of the caster), therefore there's no way to do it fast without shaders :/

If you want to test it out...





Uncle(Posted 2008) [#152]
Hello MikhailV,

Recently I release a game using your lib, but I am having a few problems with people saying they are having MAVs. When I comment out any reference to the lib the problem disappears. I am only using the blur effect. Do you have any ideas why this happens. One person said they fixed the problem by setting the path to DLL in windows. Not sure if this is clue.

Cheers,


Unc


John Blackledge(Posted 2008) [#153]
1) How can the user set the path to a DLL?
2) You mean you _didn't_?

If you're setting the path away from your default app folder, then later trying to load the DLL from e.g. "mybin\summat.dll" then Blitz won't find that folder.


Uncle(Posted 2008) [#154]
The dll is in the same directory as the exe so it should work without any path setting. Strange thing is that I also have another dll and in the directory and it causes no problem at all. Im not sure if even where the dll resides is the problem. Is there anyway limitation i.e. graphic card requirements that I can check for before calling the blur and contrast functions?


MikhailV(Posted 2008) [#155]
@Uncle: I need small example from you, where I can see MAV (advisable always). I shall pleased fix bug, but I do not see it :(


Barton(Posted 2008) [#156]
It's possible to delete the WaterClipplane separate ?

I need it for Reset the Display-Mode. When I use the Water then I get a MAM Error in FastEx.bb Line "DeInitExt_" (I use Clearworld after DeInitEx)

If I call "FreeEntity WaterClipplane" before DeInitEx then I get a MAM Error.
Alterntative, I use now "FreeEntity Waterplane", because the WaterClipplane is a Parent Object from the Waterplane, and only so it work without error.

When I delete the Waterplane and set the texture flag=0 before, then Display-Reset work fine.

It's a Bug or a Feature ? :)

I have also modife InitPostprocess% () and DeInitPostprocess% () in fastEx.bb. When I don't use Texture=0 Flag, then I get a FreeTexture_ Error when I reset the Display Mode after calling DeInitExt_.

Here the correct method:

.changeResolution
If AlphaCubemap > 0 Then FreeTexture AlphaCubemap : AlphaCubemap = 0
If WaterPlane > 0 Then FreeEntity WaterPlane : WaterPlane = 0 ;>>> VERY IMPORTANT
If ReflectTexture > 0 Then FreeTexture ReflectTexture : ReflectTexture=0 ;>>> VERY IMPORTANT!!
If RefractAndReflectTexture > 0 Then FreeTexture RefractAndReflectTexture:RefractAndReflectTexture=0 ;>>> VERY IMPORTANT!!
If camera > 0 Then FreeEntity camera : camera=0
DeInitExt
ClearWorld 1,1,1
EndGraphics

Goto loop


I have now solved all the problems but it would be better when we delete the Waterclipplane separate.


Function InitPostprocess% ()
	If FE_InitPostprocessFlag=0 Then
		FE_PostprocessTexture1 = CreateTexture ( GraphicsWidth(), GraphicsHeight(), 1 + 256 + FE_ExSIZE + FE_RENDER + FE_ZRENDER )
		FE_PostprocessTexture2 = CreateTexture ( GraphicsWidth()/3, GraphicsHeight()/3, 1 + 256 + FE_ExSIZE  + FE_RENDER )
		FE_PostprocessTexture3 = CreateTexture ( 16, 16, 1 )
		FE_PostprocessTexture4 = CreateTexture ( GraphicsWidth()/3, GraphicsHeight()/3, 1 + 256 + FE_ExSIZE  + FE_RENDER )
		FE_PostprocessTexture5 = CreateTexture ( GraphicsWidth(), GraphicsHeight(), 1 + 256 + FE_ExSIZE )	; comment this string if MotionBlur not needed (not used)

		SetBuffer TextureBuffer(FE_PostprocessTexture3) : ClsColor 255,255,255 : Cls : SetBuffer BackBuffer()
		If InitPostprocess_ (BackBuffer(), TextureBuffer(FE_PostprocessTexture1), TextureBuffer(FE_PostprocessTexture2), TextureBuffer(FE_PostprocessTexture3), TextureBuffer(FE_PostprocessTexture4), TextureBuffer(FE_PostprocessTexture5))<>0 Then
			FE_InitPostprocessFlag = 1
		Else
			If FE_PostprocessTexture1<>0 Then FreeTexture FE_PostprocessTexture1: FE_PostprocessTexture1=0
			If FE_PostprocessTexture2<>0 Then FreeTexture FE_PostprocessTexture2: FE_PostprocessTexture2=0
			If FE_PostprocessTexture3<>0 Then FreeTexture FE_PostprocessTexture3: FE_PostprocessTexture3=0
			If FE_PostprocessTexture4<>0 Then FreeTexture FE_PostprocessTexture4: FE_PostprocessTexture4=0
			If FE_PostprocessTexture5<>0 Then FreeTexture FE_PostprocessTexture5: FE_PostprocessTexture5=0
		EndIf
	EndIf
	Return FE_InitPostprocessFlag
End Function

Function DeInitPostprocess% ()
	If FE_InitPostprocessFlag<>0 Then
		If FE_PostprocessTexture1<>0 Then FreeTexture FE_PostprocessTexture1 : FE_PostprocessTexture1=0
		If FE_PostprocessTexture2<>0 Then FreeTexture FE_PostprocessTexture2 : FE_PostprocessTexture2=0
		If FE_PostprocessTexture3<>0 Then FreeTexture FE_PostprocessTexture3 : FE_PostprocessTexture3=0
		If FE_PostprocessTexture4<>0 Then FreeTexture FE_PostprocessTexture4 : FE_PostprocessTexture4=0
		If FE_PostprocessTexture5<>0 Then FreeTexture FE_PostprocessTexture5 : FE_PostprocessTexture5=0
		FE_InitPostprocessFlag = 0
	EndIf
End Function




MikhailV(Posted 2008) [#157]
@Barton:


If I call "FreeEntity WaterClipplane" before DeInitEx then I get a MAM Error.
Alterntative, I use now "FreeEntity Waterplane", because the WaterClipplane is a Parent Object from the Waterplane, and only so it work without error.
When I delete the Waterplane and set the texture flag=0 before, then Display-Reset work fine.


1. Warning! WaterClipplane - it's NOT entity, it's internal library object, use FreeClipplane function ONLY for delete clipplane or HideClipplane for hide (disable) clipplane. FreeEntity WaterClipplane code will always cause MAV!
2. After removing (deleting) clipplane - his it is impossible use in your program, be attentive, this will cause error!
3. For change Display-Mode unnecessary delete clipplanes, it is enough to use one function DeInitExt


I have also modife InitPostprocess% () and DeInitPostprocess% () in fastEx.bb. When I don't use Texture=0 Flag, then I get a FreeTexture_ Error when I reset the Display Mode after calling DeInitExt_.

Here the correct method:

.changeResolution
If AlphaCubemap > 0 Then FreeTexture AlphaCubemap : AlphaCubemap = 0
If WaterPlane > 0 Then FreeEntity WaterPlane : WaterPlane = 0 ;>>> VERY IMPORTANT
If ReflectTexture > 0 Then FreeTexture ReflectTexture : ReflectTexture=0 ;>>> VERY IMPORTANT!!
If RefractAndReflectTexture > 0 Then FreeTexture RefractAndReflectTexture:RefractAndReflectTexture=0 ;>>> VERY IMPORTANT!!
If camera > 0 Then FreeEntity camera : camera=0
DeInitExt
ClearWorld 1,1,1
EndGraphics

Goto loop


No sense in modification, I certain that error at the beginning initially your program! See attentively example FastExt_Example_ChangeResolution.bb (in archive of the library).
Also short example:
Include "include\FastExt.bb"

.changeResolutionLoop

    Graphics3D Width,Height
    InitExt

    ; ... load all application resources

    While Not Quit
        ; ... main loop
        RenderWorld
        Flip
    Wend

    DeInitExt
    ClearWorld 1,1,1
    EndGraphics

Goto changeResolutionLoop


.GlobalExitFromApplication
    End              ; <-- possible use simple 'End' function!



MikhailV(Posted 2008) [#158]
@Uncle: You use change video-mode in program? If yes, that see example post above...


Barton(Posted 2008) [#159]
@MikhailV: OK thanks. I Understand your Code now better. :)

ClearWorld don't delete the Water Textures automatically. That was the problem. I must delete this by Hand.


MadJack(Posted 2008) [#160]
Just mucking about with FastExt's DrawImageEx command.

Is there any way to use this command and have an image draw that takes distance into account (z_buffer)?

To be more specific, so that you could draw an image directly to a buffer and specify a z distance?

e.g.

DrawImageEx img, x,y,z


MikhailV(Posted 2008) [#161]
@MadJack:
First — DrawImageEx function from FastImage library, not FastExt !
Second — FastImage library does not use Z-Buffer (writeing to Z-Buffer disable). I cannot comply with your request as I should rewrite completely all engine-code of library.


MadJack(Posted 2008) [#162]
MikhailV

Sorry - getting my libs mixed up.

Is there something similar or a way to draw an image (to a buffer) with a specified z distance, in FastExt?


Naughty Alien(Posted 2008) [#163]
..what would be best way to do reflection with FastExt (not water reflection), but for non flat surfaces, such as car for example?? Whats most efficient way to do that, especially having in mind that each car near player car should have proper reflection of world too??


MadJack(Posted 2008) [#164]
NA

No, no - I had my hand up first! Teacher!


MadJack(Posted 2008) [#165]
Looks like Mikhail's gone away.

Any suggestions for NA's and my questions?


MikhailV(Posted 2008) [#166]
@MadJack: I have already answered you.

FastImage library does not use Z-Buffer (writeing to Z-Buffer disable). I cannot comply with your request as I should rewrite completely all engine-code of library.


And also the FastExt library is not intended for this purpose. Use sprites or quads (2 tringles) with a specified z-coordinate - it will solve your problem...


MikhailV(Posted 2008) [#167]
@Naughty Alien:

... best way to do reflection with FastExt (not water reflection) ...


Use cubemaps, other methods does not exist:
1. Pre-rendered - for each sectors in game (like HL2, CallOfDuty4, Crysis)
2. Realtime - for smooth meshes (like cars in NeedForSpeed game)

FastExt can render to cubemap, it's faster than CopyRect on old videocards. See example FastExt_Example_RenderCubemap.bb

p.s. Or use Env map for low-quality reflections...


Naughty Alien(Posted 2008) [#168]
..thanksss :)


Naughty Alien(Posted 2008) [#169]
hey Mikhail..a bit off topic...what tools you used for creation of bitmap fonts provided with FastImage? I really like nice outline they have and I would like to know wich tool you used...


Moraldi(Posted 2008) [#170]

what tools you used for creation of bitmap fonts provided with FastImage


I am wondering the same...


Mortiis(Posted 2008) [#171]
I downloaded a free model to test the normal mapping capabilities of FastExt, here is a result;




Mortiis(Posted 2008) [#172]
Hey Mikhail, is there any way you can add "god rays" to FastExt? I would love this feature!




Zetto(Posted 2008) [#173]
Hey guys, I havent really posted anything on the blitz forums about my project The Legend of Dekkane (www.legendofdekkane.com), however I thought it would be a good idea to show off some of the things we've managed to do with mikail's libraries here.




Thanks for the excellent effects libraries! Its worked wonders for us.
Zetto


MikhailV(Posted 2008) [#174]
@Mortiis:
Hey Mikhail, is there any way you can add "god rays" to FastExt? I would love this feature!

Excellent FX! As you has done this? ;)
It's a joke :D

I recommend to do 'fake' FX. Use sprite (with SpriteViewMode=4) or "X" mesh with two planes (like 'Laser' in cosmic games) + simple sun-beam texture. And use BlendMode=3 for rays with small alpha value. If you good modeller, that 'fake' FX will beautifully.

@Zetto: Good! I think it is necessary to add more details on the ground and mountains (else one detail-texture), IMHO...


Naughty Alien(Posted 2008) [#175]
..hey Mikhail..welcome back...I have asked this before, but ill repeat again..what tool you used for creation of bitmap fonts provided with FastImage?


Mortiis(Posted 2008) [#176]
I recommend to do 'fake' FX. Use sprite (with SpriteViewMode=4) or "X" mesh with two planes (like 'Laser' in cosmic games) + simple sun-beam texture. And use BlendMode=3 for rays with small alpha value. If you good modeller, that 'fake' FX will beautifully.


But god rays are different, they are dynamic and they even appear on foliage and trees. Yeah it seems I'm asking for too much :P Thanks man.


MikhailV(Posted 2008) [#177]
@Mortiis: No sense to create all natural and realistic (dynamic) - so much for is impossible on DX7 and Blitz3D. In 99% events possible to use 'fake' and this successfully uses in all modern games :)
Usual person (player) will not see 'fake' if you all have did neatly and beautifully.

@Naughty Alien: Sorry, tool does not exist. I'm write small program in Blitz3D and use Photoshop...


Naughty Alien(Posted 2008) [#178]
..can you suggest any tool for bitmap fonts, compatible with fastimage, or if you dont mind to post your small program so I can have same pipeline for fastimage use as you have, since im scared for some unpredictable results if I use something else..i really like fonts I saw in FastImage package after i bought it, and i was wondering what bitmap font tools are used..is it problem of any kind to give that small program for fonts creation you have, for licensed users or its 'top secret' stuff :)..


Naughty Alien(Posted 2008) [#179]
..and hey Mikhail..can you maybe post some info, what you planing to add in future for FastExt, if you do have any plans..and what chances are that you implement shadow mapping? That would be so beautiful, that ill be happy to pay for it(if it is new lib for shadow stuff, volumes, maping...).. :) .. or im talking trash here :)


kochOn(Posted 2008) [#180]
..hey Mikhail..welcome back...I have asked this before, but ill repeat again..what tool you used for creation of bitmap fonts provided with FastImage?


I use FonText165 which is free (thanks to it's author):
http://www.mediafire.com/?24ng952x3dm

I save my fonts in ini format with full charset(including 0 to 31) this is necessary to use carriage return in FastLib.
Then I use this litlle prog I've made to convert the ini file in txt format readable with fastlib

Save, compile,put in your FonText fonts folder and run it.
(remember the name of the font.ini you want to convert).



You can modify the .txt file resulting according to your needs.


Mortiis(Posted 2008) [#181]
Naughty Alien, you can buy sprite candy, it has a font tool and a library with it.


MikhailV(Posted 2008) [#182]
@Naughty Alien: See my simple program in FastImage topic - http://blitzbasic.com/Community/posts.php?topic=66995
And write your questions about FastImage in topic for FastImage library, please :)


Naughty Alien(Posted 2008) [#183]
..ahh..im so sorry Mikhail..I will do it..thanks man, I use to post here so I lost myself a bit :)

Mortiis, i do have Spritecandy but provided tools doesnt work exactly as they should with fastImage, thats why i asked Mikhail for original tools so i can have suited pipeline for that great lil cute lib..

@kochOn
Thanks man..Ill give it a crack later.. :)

@Mikhail
Shadowmaping,Shadowmaping,Shadowmaping,Shadowmaping,Shadowmaping.....few hours passed...Shadowmaping,Shadowmaping,Shadowmaping :) hehehe..


KimoTech(Posted 2008) [#184]
Isn't it a bit hard to do shadow-mapping in Blitz3D, as you will need some shader-generated UV-coordinates?

If it is possible in Direct3D7, i fully gratulate :-)


Mortiis(Posted 2008) [#185]
Before this library, I would say it's impossible to do fast normal mapping, post process etc.


MikhailV(Posted 2008) [#186]

Shadowmaping,Shadowmaping,Shadowmaping,Shadowmaping,Shadowmaping.....few hours passed...Shadowmaping,Shadowmaping,Shadowmaping :) hehehe..


Oh my God... If I do shadows, that only stensil-shadows, but this will work not quickly (very miserable that no shaders on DX7).


Naughty Alien(Posted 2008) [#187]
ahh..so there is no way to get Shadowmapping?


OJay(Posted 2008) [#188]
please face it already, nauhgty: the closest you will get to shadowmapping in blitz3d is using swifts shadows system...


Naughty Alien(Posted 2008) [#189]
hehe..thats ok..i just enjoy to play with B3D, and experimenting..sort off..so, its not about facing it or not..by the way I do have switfy system so its fine :)


Mortiis(Posted 2008) [#190]
I want to make some underwater ripple/caustics effect with FE_BUMPLUM texture blend mode applied on an animated normal map texture. I'm using it on a 3D World Studio Map, 3DWS maps are a root pivot and all the brushes, meshes etc. are this pivot's child. It is also pre textured so I can't reassign it's own texture to index number 1. It has no UV Map, it just uses the seperate textures and applies them to each brush.

I load and add the animated bump effect just as it's done in "FastExt_Example_BumpWaterAndEntity" but I get weird results. Here is a screenshot.



MikhailV(Posted 2008) [#191]
@Mortiis: I had no time to answer your letter, sorry.
Ok, if I correctly understood you - you have pre-textured entity (with chlids) from 3D World Studio.

You follow to do so:

1. About texturing in 3D editor - place white texture to zero layer with name "yourname_bump.*" and with 'Multiply' blend, and place diffuse texture to first layer with 'Multuply' blend. This will help to see (correctly) your model in 3D editor. On other it is impossible, since in 3d editor of no possibility to assign custom blend mode (FE_BUMP or other).

2. Load your 3d model in Blitz3D. And load 'bump' texture (animated normal map), set FE_BUMP or FE_BUMPLUM blend to texture.

3. Check all childs & surfaces in entity (recursive), and get brushes from surfaces. Get textures from every brush, if texture name contain text '_bump' (on zero layer), then get all textures from brush (with GetBrushTexture() function), create new brush, set 'bump' texture to zero layer in new brush, place all other textures in brush and set new brush for current surface. Brrr... :)

As example:
sf = GetSurface(mesh,i)
b = GetSurfaceBrush( sf )
t = GetBrushTexture(b,0)
If Instr(TextureName(t),"_bump")>0 Then
	; t1 = GetBrushTexture(b,1)
	; t2 = GetBrushTexture(b,2)
	; ... and other textures
	b1 = CreateBrush()
	BrushTexture b1, YourBumpTexture, 0, 0
	; BrushTexture b1, t1, 0, 1
	; BrushTexture b1, t2, 0, 2
	; ... and other textures
	PaintSurface  sf,b1
Endif


Exists other way. You can, with any HEX editor, to assign (manually or software) necessary blends for textures in final b3d-file. Use specifications for b3d files http://blitzbasic.com/sdkspecs/sdkspecs/b3dfile_specs.txt


Mortiis(Posted 2008) [#192]
Thanks man great answer, I'll try that tomorrow. I'm not sure 3DWS has multi texturing and blending modes support.


Mortiis(Posted 2008) [#193]
Josh says

No, because it would be impossible to support all the different engine material schemes that exist. It's easiest to just rely on a diffuse texture.



MikhailV(Posted 2008) [#194]
Even in such event you can use technology, described above. Jnce again:

1. Load your 3d model in Blitz3D (with diffuse texture only). And load 'bump' texture (animated normal map), set FE_BUMP or FE_BUMPLUM blend to texture.

2. Get brushes from surfaces of the mesh. Get duffuse texture from brush (zero layer). Create new brush, place 'bump' texture to zero layer and diffuse texture to 1st layer.

3. Apply new brush to surface.

Certainly given method will act on whole surface. But I think that you will not form labour to create separate surfaces, on which must act 'bump'.


Sph!nx(Posted 2008) [#195]
Is there perhaps an alternative way to purchase the library pack?

I tried to buy it through the usual way, but after clicking proceed he rejects my hotmail (any free e-mail), even though I want to do a simple pay pall transfer...


Thanks!


Mortiis(Posted 2008) [#196]
Hey MikhailV, I did as you said man and it partially worked. I have a new error now. Here is a screenshot with bumpmap and normal rendering.




MikhailV(Posted 2008) [#197]
@Mortiis: Please send me b3d-model, I solve this problem tomorrow.
p.s. I see that you wrong use bump-blend.


Mortiis(Posted 2008) [#198]
Model sent, thanks pal


MikhailV(Posted 2008) [#199]
@Mortiis: I have sent you answer and example, see mail. Bump-blend work good and correct!

@Sph!nx: Such problem exists, try google mail (gmail) or other...


Mortiis(Posted 2008) [#200]
MikhailV, I didn't get an email yet mate, can you resend it to mortiisgames@gmail


Sph!nx(Posted 2008) [#201]
Ah yeah. Google mail is free right? If that one works I will make one and buy it! If there is any news, for potential updates and stuff, it will be send to that new email... Is there a way to change the email later on?

Anyway, great work on the libs, m8. I'm sure I will enjoy them! Thanks!


MikhailV(Posted 2008) [#202]
@Mortiis: Hmm... I resend letter for you.

@Sph!nx: Google mail is absolutely free. You can change the email later (do not forget to report me about it).


Mortiis(Posted 2008) [#203]
I got it this time, working like a charm, thanks a lot!

Edit: Ok, got it to work with LoadAnimMesh now :) thanks


Sph!nx(Posted 2008) [#204]
Thanks MikhailV! I will surely buy it when my money arrives on pay pal. ... couple of days I guess ... Can't wait!


Sph!nx(Posted 2008) [#205]
Well, the transfer to my pay pal is completed and I tried to buy your package with a gmail, like you suggested, but it does not accept gmail either.

Is there perhaps a way I can buy the package from you another way? I dunno, I send money to your Pay Pal, you send me the download link and perhaps add me in your mailing list. This is just a suggestion, though. I really want to have this!


Thanks!


Beaker(Posted 2008) [#206]
MikhailV - if you create a new thread with links to and from this one, I will lock this one. It's getting a bit long. :)


LordShion(Posted 2008) [#207]
Hi,
Sorry if the question as already been raised.

I bought Blitz3D SDK , and was wondering, when will the other libs, be available for this package.
I am really interrested.

Filipe


MikhailV(Posted 2008) [#208]
Next topic ->