birdylook icon indicating copy to clipboard operation
birdylook copied to clipboard

Added some trees

Open Sjael opened this issue 2 years ago • 13 comments

Thought to try my hand at a tree shader, and this project served as some reference for shaders in general, so I decided to drop it in. The vertex shader has a wind effect using simplex noise, and the fragment shader is doing the stylized effect with spherical normals. (I left in one of your old trees as an homage)

0681e3a91e7fc6626a997bb7593f9de3

I also added some ambient and directional light, also repositioned the camera.

The leaf lighting is not reacting fully to the light direction yet, I'll probably fix that next.

~~I wasn't up to date for your recent commits, sorry about that!~~ fixed it

Sjael avatar Feb 26 '23 01:02 Sjael

Hey Sjael, implementing the leaves is a very nice idea! :+1: , I'll take a look over your code

EmiOnGit avatar Feb 26 '23 08:02 EmiOnGit

First of I'm currently not at home meaning my computer cant run the project. Could you measure the performance difference for me? You could use the FrameTimeDiagnosticsPlugin with the LogDiagnosticsPlugin from bevy to measure the fps difference

EmiOnGit avatar Feb 26 '23 08:02 EmiOnGit

In most projects, it is useful to program in a generic way. However, this project leans more to implementing only what is needed, so others can better understand the workings quickly. I tend to think of projects like this more like an example than a reference for everything you might do

EmiOnGit avatar Feb 26 '23 08:02 EmiOnGit

I think this is everything I see currently, Overall I really like it and am glad to merge it soon for others to see :) To sum up the changes I'd like in the shader: Don't let the code look more complicated than it has to be. This is not a general crate that can be used with every leave mesh. Reduce a bit of workload a bit with small tweaks.

As a note depending on the performance lost, it might be worthwhile to use instancing for the leaves instead of rendering them all one by one

EmiOnGit avatar Feb 26 '23 09:02 EmiOnGit

the leaves.png shouldn't be in the shaders directory

Also to make sure. The assets in this project are under the the CC0 1.0 Universal license. This means that your added assets should also be able to follow the same licensing

EmiOnGit avatar Feb 26 '23 11:02 EmiOnGit

btw you can also just remove the last old tree/ bonsai

EmiOnGit avatar Feb 26 '23 12:02 EmiOnGit

Got it. Seems like I get around 21 fps on the master branch, and 25 on the trees branch. 670185bf37911ace3d1d0a87ff9259bd fa5e0e3080675207f1f42da01d177307

Sjael avatar Feb 26 '23 19:02 Sjael

21? Do you run in release mode? :O

EmiOnGit avatar Feb 26 '23 20:02 EmiOnGit

If you already did, I will surely need to debug the performance. It was running on 300+ on my (rather good) pc. There might be something that weird going on

EmiOnGit avatar Feb 26 '23 21:02 EmiOnGit

Oh, woops. I did not use --release.

Sjael avatar Feb 27 '23 03:02 Sjael

cargo run --release gets 120 to 144 for me, must have a mid tier computer over here haha

a086628a56acffa86fc8191d553f53e2 11ed7bcfa7a6623a8e2b6e9d07cfb46f

Sjael avatar Feb 27 '23 03:02 Sjael

Hey @Sjael some time went by and I'm curious if you plan on further working on this? Really liked the idea

EmiOnGit avatar Mar 12 '23 13:03 EmiOnGit

Sorry, it's been a bit. Is there a change you want done?

Sjael avatar May 20 '23 06:05 Sjael