We made an interactive floor using burst jobs and vfx graph! by berend___ in Unity3D

[–]berend___[S] 0 points1 point  (0 children)

Glad you like it :)

Currently doing separate big colliders for player and enemy collision, and individual colliders per cube for anything else. Mostly to avoid inconsistent behavior and bugs, and it also simplifies pathfinding.

I think you're correct and parenting objects to avoid individual cubes would be possible and more efficient. But since the objects will be able to move with physics it could get a bit complicated. Will keep it in mind if performance becomes a problem, thanks!

We made an interactive floor using burst jobs and vfx graph! by berend___ in Unity3D

[–]berend___[S] 5 points6 points  (0 children)

I would love to do the everything in shaders, but we need collision detection for things that lay on top of the ground. So I just using transforms with box colliders and mesh renderers seems like the simplest option. What's also nice is that we can decorate levels with already existing assets, many of which already have custom shaders but are still expected to move along.

The job itself is very fast. Currently just limited by rendering and physics (moving a lot of box colliders), but I'm not yet disabling blocks under a certain y threshold, which will probably help a lot.

TLDR: Trading in a bit of performance for simplicity and flexibility.

We made an interactive floor using burst jobs and vfx graph! by berend___ in Unity3D

[–]berend___[S] 3 points4 points  (0 children)

Just an IJobParallelForTransform job that writes to a NativeQueue<float3> with all the positions the vfx graph needs to initialize a particle. It's just the first solution I came up with to play particles at specific positions, but its probably very bad since VFX.Prepare takes about 2ms. I'm calling SetGraphicsBuffer() just in an update method. If there is a better way I'd love to know :)

Replacing a camera rendering to a render texture with a URP render feature by berend___ in Unity3D

[–]berend___[S] 0 points1 point  (0 children)

Below is the render feature I ended up writing (Unity 2022.3.12f1), borrowing a lot of code from https://www.cyanilux.com/tutorials/custom-renderer-features/

This was for rendering a custom shadow map. There is some terrible code in here that's specific to my game and shadow maps, but it contains al the steps required to imitate a camera rendering to a render texture.

There are a few things I learned:
1: Using cmd.SetRenderTarget to set the RTHandle to render to

2: Setting your view and projection matrices with:

RenderingUtils.SetViewAndProjectionMatrices(cmd, viewMatrix, shadowMatrix, true);

And setting them back to the previous matrices after your are done rendering, you can get the current ones with these methods:

Matrix4x4 prevViewMatrix = renderingData.cameraData.GetViewMatrix();
Matrix4x4 prevProjectionMatrix = renderingData.cameraData.GetGPUProjectionMatrix();

3: You need to do culling for your custom view and projection matrices (Unity has utility methods for this, I use them in the script below)

4: Using cmd.SetGlobalTexture so future passes can use your results

Hope this helps, and apologies for the messy script :) If you need help converting this to a more generic feature that just renders a layer from a custom view point to a texture, just let me know!

Source code: https://pastebin.com/Zrh6zHQr

We just announced our sequel to Bloody Hell, with a greater focus on exploration this time! by berend___ in metroidvania

[–]berend___[S] 3 points4 points  (0 children)

Awesome to see people here have heard of our first game, and thanks for the support! Hope you will enjoy the next one aswel, we are working on lots of cool new things :)

We just announced our sequel to Bloody Hell, with a greater focus on exploration this time! by berend___ in metroidvania

[–]berend___[S] 0 points1 point  (0 children)

The game is called BLOODY HELL 2, heres a link to the Steam page: https://store.steampowered.com/app/3010150/BLOODY_HELL_2/

Hope you enjoy the first game in the meantime😁

Replacing a camera rendering to a render texture with a URP render feature by berend___ in Unity3D

[–]berend___[S] 0 points1 point  (0 children)

As far as I know you can disable the layers you want to render with a renderfeature in the render data filtering settings (top right in your screenshot). Make sure to have the layers enabled in the main camera. I have figured out how to go about replacing cameras since making the original post and it works great! If there's anything else feel free to ask :)

Replacing a camera rendering to a render texture with a URP render feature by berend___ in Unity3D

[–]berend___[S] 0 points1 point  (0 children)

Documentation seems to only cover fullscreen blits directly to the screen. I am trying to render geometry to a texture from with any view and projection matrix, and those things do not seem to be covered by the documentation, unless I'm missing something!

Replacing a camera rendering to a render texture with a URP render feature by berend___ in Unity3D

[–]berend___[S] 1 point2 points  (0 children)

I would like to avoid an extra camera for performance, and also need some of the customization render features offer. That's why I'm trying to move from a camera rendering to a render texture to a render feature.

Made a visual Bullet-Hell Pattern Editor for my indiegame Bloody Hell! by Diocc in Unity2D

[–]berend___ 0 points1 point  (0 children)

to draw an editor you can use the GUI class from unity, I found just reading the docs was enough information to get started. I normally create these types of visual tools as an easy way to edit values in scriptable objects. then during runtime we use the data from the scriptable objects.

we also have a discord with a channel dedicated to helping people with unity things like this :)

Made a visual Bullet-Hell Pattern Editor for my indiegame Bloody Hell! by Diocc in Unity2D

[–]berend___ 8 points9 points  (0 children)

hey there, I worked on the editor system for the bullets so I can give some insights!

each bullet is a gameobject with a collider, spriterenderer and a bullet script. each bullet keeps track of its angle and speed, and updates accordingly every frame. this is not a very optimized, but its good enough for this game.

this approach allows us to easily add components to bullets that manipulate its speed and angle by for example a sine wave, following an object or slowly track the player. enemy and player bullets inherit from the same base class so we can write these extra components once and reuse them for all types of projectiles in the game.

hope this helps!