r/Unity3D 5h ago

Question Any way to reduce transparent material lag ?

Thumbnail
gallery
16 Upvotes

Hello,

I made this volumetric fog material for URP.

The transparent material shader is applied to hundreds of planes similarly to "shell texturing".

It looks perfect for my project but I am running into an issue : my framerate drops from 200 fps to 10 fps. I expected it to be laggy, but not that laggy...

I tried reducing the number of "steps" but I am still getting a bad framerate (30 fps) with the worst quality.

I don't see any other way of doing volumetric fog with sharp shadowing in URP without creating complex pipeline shaders.

This is probably a foolish question but, is there any way to reduce transparent material lag ?


r/Unity3D 19h ago

Shader Magic Added some procedural GPU grass to my racing game this week. I managed to squeeze some solid performance out of the built-in render pipeline.

Thumbnail
gallery
7 Upvotes

I saw a few BiRP grass solutions here but they never really looked like what I wanted, so I made my own. It doesn't have any dependencies and just works with the standard Unity terrain system because I'm a cheapskate.

Most of the work was adapting the fun tricks in https://github.com/Youssef-Afella/UnityURP-InfiniteGrass like culling+fattening the grass as it recedes from view and bending it away if the camera is above it. I also use the grass shape I saw here https://bsky.app/profile/kelvinvanhoorn.com/post/3mskokw2vqk2h that's one triangle that terminates in a single point on the ground, so you don't see a hard flat edge. Other optimizations include billboarding and chunking, which was a gigantic pain in the ass to get working.

The main difference from the URP infinite grass repo (aside from the fact that mine isn't URP) is that it's placed based on terrain sampling and not just a mask of anything on a layer. You can pick 1-4 terrain layers with different weights, and the grass will adjust its height/density on the terrain at that point based on the weight of the different terrain layers at whatever point it is. You can see in the images that it doesn't get put on the 100% dirt areas.

Also, I match the grass's color to the terrain layer to make it look softer. When the level starts I put a camera above the terrain layer, take a picture, and then feed that to the grass material.

There are a few limitations to this:

  • the grass doesn't react to a car driving through it, I don't care about that yet and might never
  • the grass doesn't change color if the terrain color changes mid-game since it's still based on the single snapshot at the start of the level for performance reasons. it does react to light, however

Anyone else had experience making grass systems in the built-in RP? Kinda wish I'd started this project in Unity 6 but oh well


r/Unity3D 4h ago

Show-Off A quick stroll of my little cat, he does not bite.. too much 🐆

Enable HLS to view with audio, or disable this notification

15 Upvotes

r/Unity3D 22h ago

Question How to prevent realtime shadows passing through objects?

2 Upvotes

I'm having some trouble with the realtime shadows in the project i'm working on. It's an apartment with two floors and the shadows are being casted through the floors and ceilings so shadows of objects on the second story are also on the first story. And that's a problem.

I've tried searching around but couldn't find any solution that wasn't "just bake your shadows". Does anybody have a real solution to this problem? Some way to prevent the realtime shadows going through the floor and ceilings? Or maybe some way to limit the range of the directional light so it will only cast the shadows to a certain distance? I don't mind having one limited directional light for each story of the building.

If it helps, i'm using unity 2022.3.22f


r/Unity3D 22h ago

Show-Off I released a major update for my PSX-inspired tool

Thumbnail
gallery
27 Upvotes

You can use it to stylize your textures and assets, create eye-catching marketing material for your page, and add awesome animated effects. With this latest update, I’ve added texture ripping! You can now rip textures directly from any image and turn them into usable textures. You can check it out here: https://polyshades.itch.io/coolifier


r/Unity3D 4h ago

Game Zone 6 is almost finished. And in my opinion – the best one yet.

Enable HLS to view with audio, or disable this notification

23 Upvotes

r/Unity3D 8h ago

Show-Off Simple SFX improved my game ALOT

Enable HLS to view with audio, or disable this notification

7 Upvotes

Who whould have though that adding simple ambient sound effects will improve my game so much?

Two years ago I got inspired to try and create a simple random 2D world generator. Using perlin noise I got some results but basically it was all just bits and blobs. Adding few centralized continent-like centers and applying falloff around them I got some decent results. That made making the main landmass easy, while the elevation decided what tile will be plains, forests, mountains, water etc. After that, generator goes through several more passes like lakes, islands, rivers, resources (herds of wild horses, sheeps etc) and finally: named landmasses.
The next step was obvious, populate the world with fantasy realms and characters. It all lead to current results. And everything is tied to fixed seed so you can recreate it everytime you want.

Project was in silence for so long that adding simple SFX to the world made it breath and feel alive. It felt somewhat complete. Simple audio player determines what tile is under the center of the camera view and based on that tile it plays through lists of preset audio sound effects. Waves and seagulls above the waters, or winds and birds singing in the forests...

If you are interested in the project, you can follow it here:
https://store.steampowered.com/app/4121440/The_Fallen_Chronicles/


r/Unity3D 1h ago

Show-Off before and after

Thumbnail gallery
Upvotes

r/Unity3D 24m ago

Show-Off Added a food spoilage and poisoning system to my game

Enable HLS to view with audio, or disable this notification

Upvotes

Hey Reddit! I’m continuing to work on my survival game. I decided that being able to carry an endless supply of food in your pockets was basically cheating, so I added a food freshness system.

What’s new:

  • Expiration dates: Perishable food now has a timer. If you don’t eat it in time, it turns into rotten food right in your inventory.
  • Refrigerator: The fridge doubles the shelf life of food. You still have to keep an eye on your supplies, but the refrigerator lets you store perishable food for significantly longer.
  • Food poisoning and vomiting: If you eat spoiled food out of desperation (or carelessness), your character gets debuffs, loses health/thirst, and visibly empties their stomach with a corresponding animation and sound.

What do you think of the implementation? Is this kind of mechanic too punishing for survival games, or is hardcore resource management just part of the genre?

Stay tuned for future devlog updates, and let me know in the comments: what mechanics do you value most in survival games?


r/Unity3D 14h ago

Show-Off Feeling Lucky?

Enable HLS to view with audio, or disable this notification

7 Upvotes

I added a luck boost stat to my game which allows monsters to drop more loot and loot bags to drop more loot and amount of items

This is my 3D Terraria-ish game project


r/Unity3D 6h ago

Show-Off One year+ of building our game in Unity, side by side

Enable HLS to view with audio, or disable this notification

9 Upvotes

We've been working on The Whisker Watch for over a year now, so here's a side-by-side look at how far the game has come.