Search found 137 matches

by ShawnLG
Sep 10, 2020 16:27
Forum: Tips and Tricks
Topic: Endless loop.
Replies: 26
Views: 808

Re: Endless loop.

At first I thought this demo was a ray tracer. Closer inspection reveal it was not, or a poly fill type. After playing with it, I found out it is a voxel type. I see you are calculating dot products for every voxel. This is compute intensive. Most of the voxels share the same surface normal informat...
by ShawnLG
Jul 30, 2020 22:08
Forum: Tips and Tricks
Topic: Reverse Bits
Replies: 10
Views: 519

Re: Reverse Bits

I look forward to being scolded by admin. http://deltarho.org.uk/Downloads/eek.png Me too http://deltarho.org.uk/Downloads/smile.png . Although it would make more sense scolding the OP for not crediting the source ;-) I found the example here. https://aticleworld.com/5-way-to-reverse-bits-of-an-int...
by ShawnLG
Jul 30, 2020 5:25
Forum: Tips and Tricks
Topic: Simple Noise 1D,2D and 3D
Replies: 3
Views: 1061

Re: Simple Noise 1D,2D and 3D

It is faster to multiply with the recipical instead of all thoes ugly divisions. 'Replaced divisions with reciprocals, ShawnLG #Ifndef __SIMPLENOISE_BI__ #define __SIMPLENOISE_BI__ const as integer NOIZESIZE = 255 dim shared as single noise(NOIZESIZE,NOIZESIZE,NOIZESIZE) sub init constructor randomi...
by ShawnLG
Jul 30, 2020 4:42
Forum: Tips and Tricks
Topic: Reverse Bits
Replies: 10
Views: 519

Reverse Bits

Need bits reversed? Theres a clever bit hack for that. Function ReverseBits32(x As ULong) As ULong x = ((x And &haaaaaaaaull) Shr 1) Or ((x And &h55555555ull) Shl 1) x = ((x And &hccccccccull) Shr 2) Or ((x And &h33333333ull) Shl 2) x = ((x And &hf0f0f0f0ull) Shr 4) Or ((x And &a...
by ShawnLG
Jul 23, 2020 16:05
Forum: Community Discussion
Topic: BASIC Gaming Issue #7 is out!
Replies: 11
Views: 2432

Re: BASIC Gaming Issue #7 is out!

It's a shame he has disappeared. He has contributed so much to the BASIC community.
by ShawnLG
Jul 23, 2020 15:31
Forum: Game Dev
Topic: Liquid Fabric. A fast water ripple engine object for games.
Replies: 2
Views: 312

Re: Liquid Fabric. A fast water ripple engine object for games.

dafhi wrote:that FPS tho. A lot of integer with FP sprinkles. Good for us old dogs.


I like to use the datatype that is best suited for the job. There was a 64 bit compilation bug in LiquidFabric.bi that broke the hight map and light map functions. LiquidFabric.bi was updated.
by ShawnLG
Jul 21, 2020 19:50
Forum: Game Dev
Topic: Liquid Fabric. A fast water ripple engine object for games.
Replies: 2
Views: 312

Liquid Fabric. A fast water ripple engine object for games.

I have seen a few water ripple demos and I desided to make my own. It's more than a demo. It is in OOP model for easy use in games. It has three texture filter outputs. GetHM(): Returns a pointer to a height map image of the Liquid Fabric. The height map can be used to create a vectorized water fiel...
by ShawnLG
Jun 22, 2020 17:18
Forum: Tips and Tricks
Topic: PHP-like associative arrays
Replies: 45
Views: 7240

Re: PHP-like associative arrays

Dear ShawnLG; Thanks for your correction. I checked with the following program. There still seems to be collisions. You are right. There is still a problem with collisions. i had a feeling something was quite not right. Thanks for testing it. I was reliying on the hash key for reference for collisi...
by ShawnLG
Jun 20, 2020 16:27
Forum: Tips and Tricks
Topic: PHP-like associative arrays
Replies: 45
Views: 7240

Re: PHP-like associative arrays

I have added collision currection to the hash mapping. The hash function would be useless without it. I was unable to test it because I do not know of any collision conditions. Why is the hash table defined in two dimentions? assocarray.bi ' collision divergent by ShawnLG #Define ASSOC_ARRAY_LOG_COL...
by ShawnLG
Jun 08, 2020 2:36
Forum: Projects
Topic: "Another" 3d engine Xors3D (abandoned)
Replies: 5
Views: 734

Re: "Another" 3d engine Xors3D (abandoned)

Dr_D wrote:Hi. I'm always interested in 3D engines.


You might like Genesis3D SDK. It is also abandonware. I remember playing the demo in the late 90s. It has that nastalgec Quake feel to it. The source is in C for version 1.2, so it can be translated to FB.

https://www.genesis3d.com/
by ShawnLG
May 28, 2020 1:26
Forum: Community Discussion
Topic: which keyboard to choose?
Replies: 5
Views: 407

Re: which keyboard to choose?

A lot of the keyboards on that list is junk. The IBM model M was the best keyboard ever made but that was over 30 years ago. My first computer was a IBM PS/2 Model 30 computer wich came with a model M keyboard. It is the machine I learned Qbasic. Those where the days.
by ShawnLG
May 24, 2020 2:16
Forum: Community Discussion
Topic: BASIC is not BASIC anymore
Replies: 10
Views: 1029

Re: BASIC is not BASIC anymore

There is a workaround using marcros.

Code: Select all

#Undef Int'  Already used in FB' polluted namespace :(

#Macro Int
   Dim As Integer
#EndMacro

Int a = 10' C style define.
Print a
Sleep


Var is implicit and why was it added to FB? It is bad for code readability.
by ShawnLG
May 09, 2020 17:22
Forum: Beginners
Topic: Print bug?
Replies: 4
Views: 333

Print bug?

Code: Select all

Print &hFFFFFFFF 'Prints a -1 in the terminal. The Print function cast it as an integer it should be cast as an Uinteger.
by ShawnLG
May 05, 2020 15:27
Forum: Tips and Tricks
Topic: Wormhole effect
Replies: 34
Views: 1636

Re: Wormhole effect

The modulo can be replaced by a bitmask. This is only true for powers of two. It now runs at 360 fps! [UPDATE} Attn. 64 bit users. I have found a bug that effects the way the texture looks when compiled on 64 bit version of FreeBASIC. This is not desirable. Delete the texture "Wormhole_cloud.bm...
by ShawnLG
May 05, 2020 3:20
Forum: Tips and Tricks
Topic: Wormhole effect
Replies: 34
Views: 1636

Re: Wormhole effect

I lied. Wormhole is now running 269 fps! Using array tables is fast and all but, there is nothing faster than direct affine addressing using pointers. Wormhole_22xFast.bas 'Wormhole effect by ShawnLG #include "file.bi" #IFDEF __FB_PCOS__ 'for windows or DOS #define SLASH Chr(92)'"\&qu...

Go to advanced search