Register    Login    Forum    FAQ    PinSimDB.org

Board index » Future Pinball » BAM corner




Post new topic Reply to topic  [ 73 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
Author Message
 Post subject: Re: Shadows on playfield.
 Post Posted: Mon Feb 11, 2019 2:07 pm 
Offline
User avatar

Joined: Sat Jan 29, 2011 4:54 pm
Posts: 1201
@George.....I did not know that there was a limit of flash usage, but I do not seem to have noticed this, because I use 14 together, I have to check, however.

@Gimli....this that you mension... rav.....has already done in a previous version of TR, is unfortunately did not give the result that you too mension, even rav I gave it, because of the playfield of TR, which is dark (the graphics made it so ) the shadows are not seen, as it should.

@Rav....thanks many


Top 
 Profile  
 
 Post subject: Re: Shadows on playfield.
 Post Posted: Mon Feb 11, 2019 3:55 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2788
Location: Ontario, Canada
ravarcade wrote:
Gimli wrote:
... as shadows don't work at all on my office computers that have integrated Intel HD 4600 graphics..the maps show as black squares and no shadow is seen at all.
...

Fixed with BAM v.1.4-250.
Also problem was only in shadow-map generation. If you have shadows store inside fpt (as texture in texture-manager) all worked find in old BAM.


Thanks Rav !
It works much better.
I can now create and save shadows that I create on the integrated Intel HD 4600 graphics systems
Wild wrote:
@Gimli....this that you mension... rav.....has already done in a previous version of TR, is unfortunately did not give the result that you too mension, even rav I gave it, because of the playfield of TR, which is dark (the graphics made it so ) the shadows are not seen, as it should.


Ok , no problems


Top 
 Profile  
 
 Post subject: Re: Shadows on playfield.
 Post Posted: Wed Feb 27, 2019 9:20 pm 
Offline
User avatar

Joined: Mon Aug 15, 2011 10:02 am
Posts: 1883
Location: Argentina
Im loosing my head with this ahahahah :lol:

a) I do the shadows thing in 4 bulbs
b) Save as .tga, also saved as transparent .tga (sometimes the file save just black, same goes with the *.png inside cache)
c) Import .tga with the -shadows
d) add the ctrl+c shadows values to the Sub BAM_Init()
d) Play the table
e) all shadows are gone

Every time I run a table again the shadows map are gone.

What Im doing wrong? :oops:


Top 
 Profile  
 
 Post subject: Re: Shadows on playfield.
 Post Posted: Wed Feb 27, 2019 9:41 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2788
Location: Ontario, Canada
Hi Francisco,


Did you paste the code into the script using Control-V after you have copied to clipboard using Control -C ?


Top 
 Profile  
 
 Post subject: Re: Shadows on playfield.
 Post Posted: Wed Feb 27, 2019 10:04 pm 
Offline
User avatar

Joined: Mon Aug 15, 2011 10:02 am
Posts: 1883
Location: Argentina
Yeah yeah, I gpund that for some reason the Sub BAM_Init() is not runing :?

Edit.

Here is the code
Code:

Option Explicit            ' Force explicit variable declaration
' xBAM.FixScore







' === Dynamic Flipper Settings ===

Const BAM_VERSION = 0
AddDebugText BAM_VERSION



Sub BAM_Init()




   If BAM_VERSION < 233 then Exit Sub
   Set RightFlipperExt      = xBAM.Flipper("RightFlipper")
   Set LeftFlipperExt       = xBAM.Flipper("LeftFlipper")
   RightFlipperExt.Omega    =         43
   RightFlipperExt.SetMaterial       0.4,        0.1,       0.05,      0.065
   LeftFlipperExt.Omega     =         43
   LeftFlipperExt.SetMaterial       0.4,        0.1,       0.05,      0.065

         AddDebugText "Shadows"


'shadows
   xBAM.ShadowMap "bulb30", 2000 , 1    ,     1,      0.5,        2,       10,        0
   xBAM.ShadowMap "bulb31", 2000 , 1    ,     1,      0.5,        2,       10,        0
   xBAM.ShadowMap "bulb32", 2000 , 1    ,     1,      0.5,        2,       10,        0
   xBAM.ShadowMap "bulb33", 2000 , 1    ,     1,      0.5,        2,       10,        0

End Sub


If BAM_VERSION => 233 then
Dim RightFlipperExt,LeftFlipperExt            ' Needed for BAM
 Dim omegaCorrection
xBAM.BallSpeedLimit = 3000
End If

Sub OnPreHitFlipperSettings(FlipperExt)
   If BAM_VERSION < 233 then Exit Sub
 OnPreHitFlipperSettings_bounceControl(FlipperExt)
End Sub

Sub RightFlipper_prehit()
   If BAM_VERSION < 233 then Exit Sub
   OnPreHitFlipperSettings(RightFlipperExt)
   omegaCorrection = 43 - (RightFlipperExt.ContactPoint * 14) ' Max omega is 43 and min is 28.2.
      If RightFlipperExt.ContactPoint < 0.0 then RightFlipperExt.Omega = 43
      If RightFlipperExt.ContactPoint > 1.2 then RightFlipperExt.Omega = 28.2
      If (RightFlipperExt.ContactPoint => 0.0) And (RightFlipperExt.ContactPoint =< 1.2) then
         RightFlipperExt.Omega = omegaCorrection
      End if
      
      
   
End Sub

Sub LeftFlipper_prehit()
   If BAM_VERSION < 233 then Exit Sub
   OnPreHitFlipperSettings(LeftFlipperExt)
      omegaCorrection = 43 - (LeftFlipperExt.ContactPoint * 14)
      If LeftFlipperExt.ContactPoint < 0.0 then LeftFlipperExt.Omega = 43
      If LeftFlipperExt.ContactPoint > 1.2 then LeftFlipperExt.Omega = 28.2
      If (LeftFlipperExt.ContactPoint => 0.0) And (LeftFlipperExt.ContactPoint =< 1.2) then
         LeftFlipperExt.Omega = omegaCorrection
      End if
      
   
End Sub

'Bounce Control (Note that bounce control over rides flipper elasticity listed above. See lines "RightFlipperExt.Omega ="/"RightFlipperExt.Omega=")
Sub OnPreHitFlipperSettings_bounceControl(FlipperExt)
   If BAM_VERSION < 233 then Exit Sub
   ' Params to tweak
   const base_elasticCoef                        = 0.8  ' very bouncy flipper rubber
   const expected_ball_speed_after_hit           = 280  ' calc elasticCoef to get desired ball speed after ball hit flipper
   const minimum_elasticCoef_to_scale_fast_balls = 0.15 ' we will add this to calculated elastiCoef, so ball after hit will have aditional 5% of speed before hit
   const reduction_for_flipper_in_motion         = 0.10 ' if flipper is not in starting point, reduce elasticCoef by 10%
   const min_elasticCoef                         = 0.08 ' 2%, ball will almost glue to flipper, this is minimum value

   If FlipperExt.Hit Then
      Dim elasticCoef
      ' ball_speed_after_hit = elastic_coef * ball_speed_before_hit
      ' so, elastic_coef = expected_ball_speed_after_hit / ball_speed_before hit !
      elasticCoef = 1.0
      If expected_ball_speed_after_hit < xBAM.Ball.Speed Then elasticCoef = expected_ball_speed_after_hit / xBAM.Ball.Speed

      ' now add little bit to preserv atleast 5% of ball speed before hit (not all balls should end with 240 mm/s)
      elasticCoef = elasticCoef + minimum_elasticCoef_to_scale_fast_balls

      ' make sure, we to not have elasticCoef higher than base value
      If elasticCoef > base_elasticCoef Then elasticCoef = base_elasticCoef

      ' now, reduce elastic coef if flipper is not at StartAngle (1 deg difference or more required)
      If FlipperExt.AngleDiff > 1 Then elasticCoef = elasticCoef - reduction_for_flipper_in_motion

      ' ... finally make sure, that elasticCoef will not be "negative" or to smalll
      If elasticCoef < min_elasticCoef Then elasticCoef = min_elasticCoef

      FlipperExt.SetMaterial elasticCoef
   End If
End Sub
''''''''''''''''''''End of Flipper dynamics'''''''''''''''''''''''''''''''''



'**************************************************************
'**************************************************************
'**************************************************************



Top 
 Profile  
 
 Post subject: Re: Shadows on playfield.
 Post Posted: Wed Feb 27, 2019 10:42 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2788
Location: Ontario, Canada
Have you tried Shadows on a simple "new table" at first without the dynamic flipper code etc...

and see if you can get it to work , so you know it is not your system.
And I am sure you already have the most recent version of BAM

I find the slingshot lights on a new table with the default "Beachwood" playfield textures
shows the shadows very well


Top 
 Profile  
 
 Post subject: Re: Shadows on playfield.
 Post Posted: Wed Feb 27, 2019 11:09 pm 
Offline
User avatar

Joined: Mon Aug 15, 2011 10:02 am
Posts: 1883
Location: Argentina
Gimli wrote:
Have you tried Shadows on a simple "new table" at first without the dynamic flipper code etc...


Yes and works fine, also in the test table submited by ravarcade

Going to delete all bam and add just shadows and see if it works and go adding part by part

Edit, many thanks, now I have to figure out but, commenting all the === Ball Rolling FX === do the trick

Edit 2, aaaahhhhh :idea: the ZBRrollingballsoundslib.vbs have a BAM_Init() in the code (face palm) hahaahhahahaha


Top 
 Profile  
 
 Post subject: Re: Shadows on playfield.
 Post Posted: Thu Feb 28, 2019 2:43 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2788
Location: Ontario, Canada
Now that I think of it I keep doing that too,
It is easy to copy more than one instance of sub Bam_init


Top 
 Profile  
 
 Post subject: Re: Shadows on playfield.
 Post Posted: Sat Apr 06, 2019 11:05 pm 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 2407
Location: Arkansas, USA
If anyone is working with shadow maps, I learned from Slamt1lt's Star Trek table to set the parameter for "Reflection" on the Shadow Map option to 0. Otherwise, the whole playfield looks washed out. I'm not sure what Rav had in mind with this parameter but it doesn't seem to do what we need.

George


Top 
 Profile  
 
 Post subject: Re: Shadows on playfield.
 Post Posted: Sun Apr 07, 2019 1:43 am 
Offline
User avatar

Joined: Mon Aug 15, 2011 10:02 am
Posts: 1883
Location: Argentina
I believe that the parameter is more oriented if the bulb have a color, it will impact on the playfield with that color the higher the value, if the light is white the Reflection will be white "washing" the colors


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 73 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next

Board index » Future Pinball » BAM corner


Who is online

Users browsing this forum: No registered users and 2 guests

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to: