-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bunnymark example - add color to the bunnies #480
Comments
If you want, you can create a pull request to update the example :) |
Ok I'll do that soon. (note to self - learn more git, esp. pull requests)
…On Fri, Jan 3, 2025 at 12:06 PM JupiterRider ***@***.***> wrote:
If you want, you can create a pull request to update the example :)
—
Reply to this email directly, view it on GitHub
<#480 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADDHCQGCDZYNEEANHN2GX32I3GRPAVCNFSM6AAAAABURACUX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRZGYZDENZYHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
- mark
|
Will that affect benchmark in any way, and how is it handled in other bindings? I recently saw a bindings benchmark, so it would be nice if they are all similar enough. |
Good question. I'm in the learning phase so my goal was to mimic the
raylib example while learning Go.
Note: I don't code for a living.
1. One current difference between Go and C examples is the bunnymark
graphic.
Go binding: wabbit_alpha.png: PNG image data, 26 x 37, 8-bit/color RGBA,
non-interlaced
Raylib: wabbit_alpha.png: PNG image data, 32 x 32, 8-bit gray+alpha,
non-interlaced
I'm using a lowly mini pc with an N100 chip to test. With no changes to
the source, just the graphic, performance is very slightly improved using
the Raylib version. As is, 12-13k bunnies starts to dip below 60fps. The
raylib graphic in Go gets a few hundred more bunnies before it dips below
60.
2. Raylib also uses 800x450 resolution for just about every example - Go's
example is 1280x960
If I drop the resolution to 800x450 - the bunny count goes up to ~22k
bunnies at 60fps.
3. Here's the part i don't understand... I get 75k bunnies before dropping
below 60fps with the changes below.
Here's the diff between original and my changes.
< b.Speed.X = float32(rl.GetRandomValue(250, 500)) / 60.0
< b.Speed.Y = float32(rl.GetRandomValue(250, 500)-500) / 60.0
---
b.Speed.X = float32(rl.GetRandomValue(-250, 250)) / 60.0
b.Speed.Y = float32(rl.GetRandomValue(-250, 250)-500) / 60.0
b.Color.R = uint8(rl.GetRandomValue(50, 240))
b.Color.G = uint8(rl.GetRandomValue(80, 240))
b.Color.B = uint8(rl.GetRandomValue(100, 240))
b.Color.A = uint8(rl.GetRandomValue(100, 255))
< rl.DrawTexture(texture, int32(b.Position.X), int32(b.Position.Y),
rl.RayWhite)
---
rl.DrawTexture(texture, int32(b.Position.X), int32(b.Position.Y), b.Color)
__
I will look at some other bindings to see how they handle this example.
Best,
Mark
…On Thu, Jan 9, 2025 at 11:34 AM Milan Nikolic ***@***.***> wrote:
Will that affect benchmark in any way, and how is it handled in other
bindings? I recently saw a bindings benchmark, so it would be nice if they
are all similar enough.
—
Reply to this email directly, view it on GitHub
<#480 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADDHCXRP4LDVC2TCRKG3HD2J2XLHAVCNFSM6AAAAABURACUX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOBQHA4TCNBRGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
- mark
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I noticed all the bunnies are gray. Two small changes add random colors and alpha to each bunny. (at least it works in linux :)
The text was updated successfully, but these errors were encountered: