Fast Extend library - Thread 6

Blitz3D Forums/Blitz3D Userlibs/Fast Extend library - Thread 6

Beaker(Posted 2011) [#1]
Continued from Thread 5 here.


Leon Drake(Posted 2011) [#2]
First


lauri(Posted 2011) [#3]
I said: "Help! I can't get FastExt working. All postprocessing and shadow examples cause MAV and bump examples run but bumping doesn't work."

I have noticed that setbuffer() in fastext.bb causes the MAV. And I use fastext v.1.17.


Yasha(Posted 2011) [#4]
Do you also have the latest Blitz3D update? Because I think you have to match up FastExt versions to Blitz3D versions, as FastExt is often updated to take account of changes in Blitz3D.


Yue(Posted 2011) [#5]
Function D_Botones(Imagen1%=0,Imagen2%=0,Imagen3%=0,PX%,PY%)
Local MX#=MouseX()
Local MY#=MouseY()
If TestImage(MX#,MY#,PX,PY,Imagen1%,128)= False
 DrawImageEx(Imagen1%,PX%,PY%) ElseIf TestImage(MX#,MY#,PX%,PY%,Imagen1%,128) = True
If MouseDown(T_Mouse1)
DrawImageEx(Imagen3%,PX%,PY%)
Tecla = True
ElseIf MouseDown(T_Mouse1) = False
DrawImageEx(Imagen2%,PX%,PY%)
If Imagen1% = Salir1  And Tecla = True
End
Tecla = False
ElseIf Imagen1% = Iniciar1 And Tecla = True
Posicion = 4
Progreso = 0
Tecla = False
ElseIf Imagen1% = Opciones1 And Tecla = True
Menu = 3
Tecla = False
ElseIf Imagen1 = OVideo1 And Tecla = True
Menu = 4
Tecla = False
ElseIf Imagen1% = OAudio1 And Tecla = True
Tecla = False
ElseIf Imagen1% = OControl1 And Tecla = True
Tecla = False
ElseIf Imagen1% = Creditos1 And Tecla = True
Tecla = False
ElseIf Imagen1% = Regresar1 And Tecla = True And Menu = 3
Menu = 0
Tecla = False ElseIf Imagen1% = Cargar1 And Tecla = True
Tecla = False
ElseIf Imagen1% = Guardar1 And Tecla = True
Tecla = False
End If End If End If
End Function


Perhaps this feature will serve someone, your goal is to work with buttons in a menu (precionamos, when it happens, and when it is released.)


coffeeaddict(Posted 2011) [#6]
I am having an issue using bump mapping a cube with FastExt. I am very new to this so please cut me some slack. This is what I am getting:



The code:
Include "include\FastExt.bb"

Graphics3D 800,600,0,2

InitExt

testCube=CreateCube()
diffuseTexture=LoadTexture("media\box.jpg",1)
normalMapTexture=LoadTexture("media\box_bump.jpg")
TextureBlend normalMapTexture, FE_BUMP

EntityTexture testCube,normalMapTexture,0,0
EntityTexture testCube,diffuseTexture,0,1

camera=CreateCamera()
PositionEntity camera,0,0,-4
light=CreateLight()
AmbientLight 128,128,128
PositionEntity testCube,0,0,0

While Not KeyHit(1)
	TurnEntity testCube,0,0.5,0.5
	RenderWorld
	Flip
Wend


Suggestions on how to fix this would be very much appreciated.


Blitzplotter(Posted 2011) [#7]
Hey Mikhail, thanks for such an excellent lib, having fun :-

(please note, the images for load, save & quit were slight modifications on the media supplied by Mikhail ;)

[EDITED]

Last edited 2011


coffeeaddict(Posted 2011) [#8]
^^I would really appreciate it if someone could give me a hard shove in the right direction on how to solve my problem.


Blitzplotter(Posted 2011) [#9]
@coffeeaddict, sorry, my limited xp cannot help you.

[EDIT] sorry, there was to much spaghetti code there for analysis.....

Last edited 2011


Yasha(Posted 2011) [#10]
EDIT: Ah right I see.

I think the FastExt bump mapping is only meant to work as environmental bump mapping for reflective objects. Non-reflective objects have no use for such a feature because they can't reflect the environment.

I have the feeling thgat what you're actually looking for is the B3D native Dot3 blend mode.

Last edited 2011


Blitzplotter(Posted 2011) [#11]
Does fastimage.bb affect the distance that 3D objects are rendered at? (basicallt the cam range) I suspect not but if someone can let me know I'd appreciate it.


Rroff(Posted 2011) [#12]
What you need is the custom blend mode D3DTOP_DOTPRODUCT3 (not sure if its different to blitz's blendmode 4) its a little more tricky than that tho you need to update the color channels if you want the bump mapping to update correctly in realtime (theres a couple of threads on this somewhere).


D3DTOP_BUMPENVMAP which your looking at (FE_BUMP) is documented as "per pixel env map perturbation".

Last edited 2011


coffeeaddict(Posted 2011) [#13]
Thanks for the help. :)


sniper_boy147(Posted 2011) [#14]
Gosh, maybe this is the solution to the problem I've been having. I've been looking at teh dot3 example in FastEx, but I've had so much trouble trying to add multiple light support. However the ENBM has that support, I guess because it takes data directly from Blitz lights. :\ Well if anyone else has other suggestions to help me accomplish this, please do! I've spent many many months on this problem D:


Blitzplotter(Posted 2011) [#15]
Sorted my camera distance problem, and got buttons within my GUI working Woo hoo!

Last edited 2011


lauri(Posted 2011) [#16]
I'm trying to make shadows like ShadowsMultipleIncreaseRangeTrick example, but there is empty border between sharp shadow and low-res shadow. And other side, there darker area.




Kryzon(Posted 2011) [#17]
Your image is broken. ImageShack requires registration now.

Use tinyPic. Works just as well.


lauri(Posted 2011) [#18]
It works in my own computer, in my mobile phone internet and in our scool computers.


Leon Drake(Posted 2011) [#19]
i think a more pressing matter is the fact your characters head is bald and blue


Kryzon(Posted 2011) [#20]
i think a more pressing matter is the fact your characters head is bald and blue

I don't know why but I laughed so hard at this..


lauri(Posted 2011) [#21]
...it is zombie...


lauri(Posted 2011) [#22]

Here's the bald blue guy from front (:
But does anyone know answer, please?


Yue(Posted 2011) [#23]


=) Shadow easy .


Wigwam(Posted 2011) [#24]
I just downloaded the Trial of this, and I can't find out how long the trial lasts. Also, if I purchase it during the trial, will I need to remove the existing files?


Rroff(Posted 2011) [#25]
AFAIK there is no limit in terms of days how long you can "try" FastExt, the trial limitations are:

Applications using FastExt will only run a certain number of minutes before FastExt stops working (not sure how long off the top of my head but I suspect its something like 5 minutes).

You don't have permission to legally distribute the FastExt runtime as part of your project.


Once you've licensed the software both of these restrictions go away.


Wigwam(Posted 2011) [#26]
Okay, gotcha. I'm not sure I trust the pay portal, though.


Yue(Posted 2011) [#27]


Hi, I have a doubt, is a reference system where an object sombrsa casts a shadow and is shaded, the case is that the character to put in front of the column is not the shadow is cast on the column.

Is this possible?


Zeotrope(Posted 2011) [#28]
Ok...I know i'm dragging up an old thread etc, but I cannot find a solution to my shadow issues.

Above, YUE asks the question that I also need an answer to. (And perhaps an example)

HOW CAN I MAKE AN OBJECT BOTH RECIEVE AND CAST A SHADOW???

Please post an example. I have managed to put shadows in my project but cannot seem to make any object display both shadow properties (Rec and Cast)

Any ideas? Not possible? I saw it done in a ZIP link somewhere on this site....Zip was called PROSHADOWS 5 and it clearly shows the shadows I require. I want to buy this library etc, but cannot get any clear answers.

HELP!

Last edited 2011


Yasha(Posted 2011) [#29]
Depending on how the system works (I can't remember offhand, this might not be appropriate) -

You could create a copy of the object to self-cast, shrink it by a small distance along its vertex normals (e.g. 0.01; enough to guarantee it stays hidden, and its shadow surface is below the original, while not noticeably affecting its profile), and leave it in the same position as the original. You could then use it as a caster and the original as a receiver. If the self-shadowing object is animated, you'd animate both entities the same way so that they perfectly match positions.

"True" self-shadowing almost certainly isn't possible at all using this projective method.


Rroff(Posted 2011) [#30]
Unfortunatly there doesn't seem to have been a proper "release" of the "proshadows" version (which was made by someone else) as part of fastlib which is the only way to do self-shadowing with it.

You could do quick and dirty self-shadowing on objects using "ICU" style dynamic lightmapping it might work well enough for individual player models, etc. especially if you can work out the rectangle they exist in on screen (to reduce number of pixel reads required).


Zeotrope(Posted 2011) [#31]
@ Yasha. Yeah. Tried this with some less than desired results.

@ Rroff. What I need is for the tree canopy to cast shadows on my weapon as I pass under the tree. The gun itself should also cast shadows to the ground (as I look down)

Oh well. Maybe they will reveal the secret from PROSHADOW.....maybe.

Last edited 2011


Rob the Great(Posted 2011) [#32]
I believe that you can simulate this effect, but it's not quite possible to achieve perfectly. From what I remember by the examples, you need to create a multiple shadow system. In one system, you need the mesh (the gun in this case) to be the caster, and in the other system, you need it to be the receiver. I haven't played around with it, but I remember that the example could do this technique really well. It takes up a lot of processing power, though.

If this sounds right, let me know and I can see if I can put together an example for you.


Zeotrope(Posted 2011) [#33]
Sure Rob. Please show me how. (I tried this ....had 2 light systems etc, but couldnt get it to work)

If I can get this working, my project (sterted in 2004) should have an end in sight. Or at least another twist and turn.


Rob the Great(Posted 2011) [#34]
I'll see what I can put together. Plan on a response tomorrow sometime.


Rob the Great(Posted 2011) [#35]
So, I got called in to work yesterday unexpectedly, but I worked on it this morning. This code will demonstrate the multiple shadow system.

There's issues where shadows are appearing on the gun when it's on the "sunny" side of the tree in addition to the "shady" side of the tree. I can't remember off the top of my head how I corrected this problem (something to do with being able to see the light or not), but this gives you an idea of what's going on.

I'm reading over the posts again, and I don't think I fully understood what you were asking. There's a lot of posts about self-shadowing, but this isn't a self-shadowing system. I don't even know if that's possible. Rather, this is a multiple-caster system, where a tree mesh will cast shadows on a gun, and both the tree and the gun will cast shadows on the ground.

You should be able to copy this code into a blank .bb file, save that file in the right folder to use the FastExt library, and change the include directories to match that for the FastExt includes.

Hope this helps:
Include "include\FastExt.bb" ;The fast extension library. Mine is probably different from your directory, so be sure this is set right.

Include "include\ShadowsMultiple.bb" ;the function includes, same situation as above.

Graphics3D 800,600,0,2 ;set graphics

InitExt() ;set up fast extension

SetBuffer BackBuffer() ;set the back buffer

;This will make a gun
Global gun = CreateCylinder()
RotateMesh gun,90,0,0
ScaleMesh gun,0.25,0.25,1.0
Local gunhandle = CreateCube()
RotateMesh gunhandle,10,0,0
ScaleMesh gunhandle,0.24,0.5,0.24
PositionMesh gunhandle,0,-0.5,-0.85
AddMesh gunhandle,gun
FreeEntity gunhandle
Local guard = CreateCylinder(8,False)
RotateMesh guard,90,90,0
ScaleMesh guard,0.09,0.25,0.25
PositionMesh guard,0,-0.25,-0.35
AddMesh guard,gun
Local guard2 = CopyMesh(guard)
FlipMesh guard2
AddMesh guard2,gun
FreeEntity guard
FreeEntity guard2
MoveEntity gun,0,0,10

;This will make a simple tree
Global tree = CreateCone()
ScaleMesh tree,5,5,5
EntityColor tree,0,128,0
MoveEntity tree,5,1,10

;Make a camera
Global camera = CreateCamera()
MoveEntity camera,5,5,0

;Make a light
Global light = CreateLight(1)
Local lightcube = CreateSphere()
EntityFX lightcube,1
ScaleEntity lightcube,0.5,0.5,0.5
EntityParent lightcube,light
MoveEntity light,100,100,100
PointEntity light,gun

;Make something to catch the shadows
Global ground = CreateCube()
ScaleEntity ground,1000,1,1000
EntityColor ground,128,100,50
MoveEntity ground,0,-10,0

;Here we go!
;First, set up some globals
Global shadow1.Shadow
Global shadowtex1
Global shadow2.Shadow
Global shadowtex2
;Now, let's make shadow 1 for the ground
shadow1.Shadow = CreateShadow()
;just set up the shadow to look pretty
ShadowRange shadow1,50
ShadowPower shadow1,0.5
;grab that shadow's texture
shadowtex1 = ShadowTexture(shadow1)
;make the gun a shadow caster on the grou
CreateShadowCaster shadow1,gun
;CreateShadowCaster shadow1,tree ;I commented this out to get darker shadow effect, but uncomment and remove the line below for normal shadows
;Attach the shadow direction to our light
ShadowLight shadow1,light
;Next, let's make a second shadow system, and this one will go on both the gun and the ground.
shadow2.Shadow = CreateShadow()
;Make it look pretty...
ShadowRange shadow2,50
ShadowPower shadow2,0.5
;grab the shadow texture
shadowtex2 = ShadowTexture(shadow2)
;Make the tree the shadow caster. Currently, this will cast on the ground as well, but you're limited to only 7 entities at a time with this method
CreateShadowCaster shadow2,tree
ShadowLight shadow2,light

;Now, apply the shadow texture to each entity receiving shadows
;First, the ground gets the normal shadow texture
EntityTexture ground,shadowtex1,0,2
;Next, the ground also gets the shadows from the tree. Comment out this line and remove the comment in the line above to return to normal shadows.
EntityTexture ground,shadowtex2,0,3
;Finally, give the gun the second shadow system. This will darken the gun in the tree's shadow
EntityTexture gun,shadowtex2,0,2


While Not KeyDown(1) ;THE MAIN

	;Basic camera movement
	If KeyDown(205)
		MoveEntity camera,1,0,0
	EndIf
	
	If KeyDown(203)
		MoveEntity camera,-1,0,0
	EndIf
	
	If KeyDown(44)
		MoveEntity camera,0,0,1
	EndIf
	
	If KeyDown(45)
		MoveEntity camera,0,0,-1
	EndIf
	
	If KeyDown(200)
		TranslateEntity camera,0,1,0
	EndIf
	
	If KeyDown(208)
		TranslateEntity camera,0,-1,0
	EndIf
	
	;Basic gun movement
	If KeyDown(30)
		MoveEntity gun,-1,0,0
	EndIf
	
	If KeyDown(32)
		MoveEntity gun,1,0,0
	EndIf
	
	If KeyDown(17)
		MoveEntity gun,0,0,1
	EndIf
	
	If KeyDown(31)
		MoveEntity gun,0,0,-1
	EndIf

	;always be facing the gun
	PointEntity camera,gun
	
	UpdateWorld
	UpdateShadows(camera) ;update the shadows
	RenderWorld
	
	Text 0,0,"Use Left and Right Arrows to move the camera on the local x axis."
	Text 0,15,"Use Z and X to move the camera on the local Z axis."
	Text 0,30,"Use Up And Down Arrows To change the camera pitch angle."
	Text 0,60,"Use A,W,S,D to move the gun around the scene."
	Text 0,75,"Notice what happens when the gun is in the tree's shadow"
	
	Flip
	
Wend

DeInitExt() ;exit

End



Zeotrope(Posted 2011) [#36]
Thanks for the code, Rob. Will check it out when I get home from Work.

As for understanding my post, you got it in one. To me, self-shadowing (not what Im asking here) is for instance, a tree casts shadows of its own branches - onto it's own trunk etc.

While this library is great, I see it's limits. For example: If I make the GUN in my FPS a Shadow Receiver, the gun correctly goes into shade when I pass under the tree. BUT! When I pass over a ground shrub that also casts a shadow, the same occurs to my gun. This System cant define if you are under/over an object. Not that I can see anyway.

On the plus side, this shadow system made me dust off my old project(s) and have another look.

Cheers.

Last edited 2011


Rob the Great(Posted 2011) [#37]
The way I got around that problem was calling EntityVisible(receiver,shadowlight) and the EntityPickMode caster,2. If the light is visible from the receiver's perspective, then I would hide the receiver shadows, and if it wasn't visible, then I would show the receiver shadows. Not perfect, but a closer representation to knowing whether or not the mesh should be getting shadows.

Last edited 2011


Zeotrope(Posted 2011) [#38]
It works Rob. Thank you. I will take a hard look at the code, adapt my code accordingly and upload the results when I can. Maybe a youtube vid.

Thanks again for taking the time to help me with this. I need to lightmap my level and add your shadow code etc. Should look the goods. Cheers!


Zeotrope(Posted 2011) [#39]
Ok. Made a small video showing my shadow system in action. As this a continued work in progress, more videos to come.

http://www.youtube.com/watch?v=2fFxTQmiCz4

Rob. This 2 light / shadow system is a bit clumsy. It works in a limited way and for now it's fine....but I wish they would release a version similar to the Proshadow version. I guess I will have to be patient.

At the moment, overlapping shadows do not blend well. They amplify the shadow alpha so that the overlap is twice as dark as it should be.

:)

Last edited 2011


Blitzplotter(Posted 2011) [#40]
Hi,

stuff:-



Last edited 2012


Yue(Posted 2012) [#41]
Error DOF, Entity Alpha.



Last edited 2012


Yue(Posted 2012) [#42]



Yue(Posted 2012) [#43]
Error!!


RenderToCubemap Yes Error TurnEntity


RenderCubemapCopyRect No Error turnentity




Last edited 2012


_PJ_(Posted 2013) [#44]
Real simple question regarding the FastExtension libraries:

Does anybody have a good, English translation of the License_retail.txt file?


Danny(Posted 2013) [#45]
@MikhailV !!

My clients detected a huge memory leak in my application: causing systems to slow down and crash after every few hours of work!!

After much time of searching, I found out the problem is FastText.dll (1.26 retail version).

Using "Text_()" on a DUAL MONITOR setup will ALWAYS produce a memory leak !!!

On single-monitor setups: there is no problem.

Here is some additional information to help you:

# To reproduce: Run ANY of the included FastText examples for Blitz3D - with 2 monitors attached! And see slow but substantial increase of memory usage in Task Manager.

# The more text you print to screen, the bigger & faster the leak!
# Task Manager shows a 256k memory increase PER second when running at 50 fps.
# I don't believe "TextRect_()" has a memory leak, but maybe very very slow/small ?!
# Disabling the 2nd monitor also fixes it - but this is not very acceptable of course :)
# It happens on Windows Vista, Win7 and Windows 8.
# It happens with Blitz3D 1.98 up to the latest 1.106
# I've tested on ATi AND NVidia cards: Same results.
# The memory leak problem also exists in version FastText 1.22 (and 1.26)!
# Everything else works perfect!! :)

I hope you guys can fix this problem very very soon, you can understand this is a big problem.

Good luck and thanks for all the other good work!!

Danny


yaragad(Posted 2013) [#46]
I can corroborate this. I bought Blitz3D 1.106 and Fastext 1.26. It works perfectly until I connect a second monitor, when I get the memory leak after some hours. Memory is stable until it shoots after some hours.

I have Intel Graphic card.


jfk EO-11110(Posted 2013) [#47]
so, does it happen only with Text_, or in general? As far as I see, in SMK there ain't no such leak but I may double-check it. I have to say I used to mod it so it does use only what I needed (render to texturebuffer) and won't substitute any blitz command.