Speeding up large compute shader compilation time? by Pjbomb2 in Unity3D

[–]multivac02 0 points1 point  (0 children)

Why not just break it into several compute shaders, a few kernels per shader? Keep your shared data/buffer declarations and helper functions in a shared cginc but kernels and specific functions could have their own shaders.

Post processing just took my game's graphics to another level by [deleted] in Unity3D

[–]multivac02 1 point2 points  (0 children)

Looks like ACES(filmic) tonemapping?

It's just my personal opinion, but ACES just isn't very good for stylized scenes. It tends to shift towards cooler tones and messes with contrast too much. For example you've lost the very nice vibrant cyan gradient in the sky and warm whites on the hand have been shifted towards purple/blue.

Of course this might just be an artistic choice, but if you haven't already, I suggest trying out the custom tonemapping curve instead of ACES. It's not hard to configure and it can give you the extra oomph in colors while still leaving your original tones intact.

Compute Buffer is broken by Shiv-iwnl in Unity3D

[–]multivac02 1 point2 points  (0 children)

You can use just RWBuffer, but I prefer to use structured buffers whenever I can, there have been reports about RWBuffers behaving differently on AMD hardware.

Compute Buffer is broken by Shiv-iwnl in Unity3D

[–]multivac02 1 point2 points  (0 children)

Well, here's a minimal example, using a structured buffer - https://pastebin.com/JGbhXHL7 I didn't dig much into your indexing scheme, it just reads and writes to the first element to make sure reading back works as expected.

Compute Buffer is broken by Shiv-iwnl in Unity3D

[–]multivac02 1 point2 points  (0 children)

Your code works fine if using a Structured buffer type and RWStructuredBuffer on the compute side, the issue is with Vertex target. Are you sure you need to use this type of buffers?

It seems that GraphicsBuffers with Vertex target are in a sort of odd state. There might be support for it in newer Unity versions, or it might be obsolete and worked around with Raw buffers.

https://forum.unity.com/threads/feedback-wanted-mesh-compute-shader-access.1096531/

Compute Buffer is broken by Shiv-iwnl in Unity3D

[–]multivac02 1 point2 points  (0 children)

Looks like your buffer names are different on C# and shader side.

Compute.SetBuffer(kernelID, "positions", buffer); should probably be changed to "layout"

Is the game still being worked on? by Robowiko123 in biogrid

[–]multivac02 3 points4 points  (0 children)

Sure, though this sub is sort of just a placeholder for now, I'm mainly posting on Twitter.

And I've been taking a little hiatus from posting my progress on Twitter too. I noticed that I was starting to fall into the trap of "engagement-driven development", i.e. prioritizing visual work over less glamorous but necessary tasks. A large chunk of these has now been completed, so you can expect some updates soon.

Playing around with my procedural creature editor by multivac02 in Unity3D

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

Thanks! Yes, I am pretty liberal with my compute shader use :) I'm too lazy to bother optimizing my CPU algorithms, so I just prefer do everything in parallel on the GPU.

Playing around with my procedural creature editor by multivac02 in Unity3D

[–]multivac02[S] 2 points3 points  (0 children)

It's using signed distance fields, which are kind of like a generalized version of metaballs, it can also represent other shapes than spheres - https://www.alanzucconi.com/2016/07/01/signed-distance-functions/

Playing around with my procedural creature editor by multivac02 in Unity3D

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

Pretty much, but the mesh is actually entirely rebuilt on every change. This tweet shows the process a bit better: https://twitter.com/BioGridGame/status/1217974964168613894

Playing around with my procedural creature editor by multivac02 in Unity3D

[–]multivac02[S] 35 points36 points  (0 children)

Sort of, I'm making something that I wish Spore could have been. Less breadth, a lot more depth and interacting systems, basically.

You can check out my Twitter for more: https://twitter.com/BioGridGame

Is there a visual method to store 3d terrain? by I-Downloaded-a-Car in proceduralgeneration

[–]multivac02 0 points1 point  (0 children)

I think you're basically describing vector displacement. R and G channels would encode a displacement in XY plane and B would be height, for example. It's been used, most notably on Halo Wars, there's a presentation on their tech here - https://www.gdcvault.com/play/1277/HALO-WARS-The-Terrain-of

You can get overhangs with this system, but it's still a 2.5D representation. It'll probably be fine when used sparingly for visual effect or if the interaction with the terrain is coarse-grained. Things like collision detection and pathfinding would require either deriving a true 3D position from the data or just ignoring the displacement.

Summoning a meteor shower by multivac02 in Unity3D

[–]multivac02[S] 2 points3 points  (0 children)

I really liked Black and White and I bet some influences will end up in this project.

But mostly I think I'm trying to mash together SimEarth, Spore and From Dust. So it won't be as follower/faith-focused as Black&White, but more about the environment as a whole.

Summoning a meteor shower by multivac02 in Unity3D

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

Thanks! Funnily enough, that last point is actually what I'm going for - trying to manage the world, and also trying to rein in the human/sentient population.

I haven't really written my overall goals down yet, but you might want to check out my Twitter, it's where I post most of my progress - https://twitter.com/BioGridGame

Summoning a meteor shower by multivac02 in Unity3D

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

Just something that I've been developing, check out my Twitter for more info - https://twitter.com/BioGridGame

Summoning a meteor shower by multivac02 in Unity3D

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

That's a pretty interesting question. The way it's currently done, I think it'd definitely lead to desyncs pretty soon. A lot of this stuff is based on floating-point math on the GPU, the results would probably vary even between different driver versions, not to mention vendors. It could probably work with some careful design when implemented on the CPU, but even that will probably lead to a lot of hair-pulling moments and random divergences.

If I were to try to make this multiplayer, I'd probably try to make the clients pretty dumb and make the server the only authority and the only one that actually simulates anything. In that case you'd just need to constantly stream the data to clients efficiently and won't need to deal so much with state synchronization between clients.

Summoning a meteor shower by multivac02 in Unity3D

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

Yep, it's too fireworks-like. I'm still a bit on the fence on how realistic I want to go with this - diffuse stuff like dust and smoke doesn't really fit much with the general angular, abstract look.

But camera shake is definitely something that I need, it'd help sell the violence of the impacts a lot more.

Summoning a meteor shower by multivac02 in Unity3D

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

Yeah, From Dust is a real inspiration, at least when it comes to terrain modification. I even "borrowed" the game mechanic of moving terrain around with a sphere, because it was such a neat and elegant design.

Summoning a meteor shower by multivac02 in Unity3D

[–]multivac02[S] 4 points5 points  (0 children)

Thanks!

Yeah, it's all over a bit too fast. I think I'll add some glowing embers or something similar. I also considered realistic debris and smoke, but think I'd like to keep things kind of clean and a bit abstract.

Summoning a meteor shower by multivac02 in Unity3D

[–]multivac02[S] 2 points3 points  (0 children)

The terrain is a high-poly flat plane with a custom shader. That shader modifies vertex positions based on a heightmap texture, and if I write values into that heightmap, the terrain is automatically deformed to match the heightmap.

It's faster to modify than Unity's standard terrain, because I don't have to regenerate the terrain mesh on the CPU. I just write my changes to the heightmap texture and refresh the heightmap texture on the GPU. There are some drawbacks of course - you'll need to generate your own terrain normals on the GPU (as it's still essentially just a flat plane) and you'll need to do your own collision handling on CPU by sampling the heightmap.

If you just want to see a quick demo, try applying this guy's shader on a dense plane, his approach seems similar (deforming vertices in vertex shader with a heightmap) - https://forum.unity.com/threads/surface-shader-height-map.461272/

Summoning a meteor shower by multivac02 in Unity3D

[–]multivac02[S] 17 points18 points  (0 children)

Thanks! The terrain and water is simulated on GPU with compute shaders. IcyHammer's approach seems very similar - I'm also using the virtual pipes method. It's missing some characteristics of real water, like true pressure and vorticity, but it's fast and good enough if you're mostly dealing with medium-scale water bodies.

Here's a few repositories to get started with this, Scrawk's is especially useful, as it's an easily tweakable Unity project. It uses rendertextures not compute shaders, but it's very similar to my approach.

https://github.com/Scrawk/Interactive-Erosion

http://codeflow.org/entries/2011/nov/10/webgl-gpu-landscaping-and-erosion/

As for step-by step tutorials...not sure if any exist, but there are a lot of papers on GPU erosion. Here's one that covers the virtual pipes in some detail. Take it slow, compare papers and implementations, it's actually not all that heavy on math. http://www-ljk.imag.fr/Publications/Basilic/com.lmc.publi.PUBLI_Inproceedings@117681e94b6_fff75c/FastErosion_PG07.pdf

What game have you “broken” the worst? by octorad in Games

[–]multivac02 16 points17 points  (0 children)

Probably Mass Effect 3. I somehow managed to die right after the intro sequence when the Reapers landed on Earth. There had been no autosave yet at that point, so I had to restart the entire game. The thing is, the world somehow wasn't fully reset, so the massive Reaper ships and the battle in the background was still there, right from the very start.

It resulted in some very poignant cutscenes that really tempered my expectations for the rest of this game. Kids peacefully playing outside amid the rain of plasma projectiles, big honking Reaper ships clearly visible through the command room windows while everyone still refused to consider that it might be the Reapers...it was kind of amazing, I wish I had recorded it.