Skip to content
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

Can't run project in unity 2020.3.2f1 #2

Open
inh4les opened this issue Apr 7, 2021 · 28 comments · May be fixed by #4
Open

Can't run project in unity 2020.3.2f1 #2

inh4les opened this issue Apr 7, 2021 · 28 comments · May be fixed by #4

Comments

@inh4les
Copy link

inh4les commented Apr 7, 2021

I loaded up the project in unity, opened the slime scene, and pressed run. Black screen.
I've messed around with some settings in hopes of getting it to work but to no avail.
I'm not sure what i could be doing wrong here, any help would be appreciated.

@inh4les
Copy link
Author

inh4les commented Apr 7, 2021

Here are some images:
fresh project
opening slime scene
pressed play

@inh4les
Copy link
Author

inh4les commented Apr 8, 2021

image
Now im getting this error for some odd reason.

@marvosyntactical
Copy link

For me its similar to your first few screenshots in Unity 2020.3.3f1 (after letting Unity import the project to the new version). I just get a blue background and nothing happens.

@marvosyntactical
Copy link

Ok so I was able to resolve my problem at least: I did not select the scene Slime.unity. When I selected it before running the scene, I saw beautiful slimes.

@asvarga
Copy link

asvarga commented Apr 11, 2021

Is this a Mac problem? I'm not very familiar with Unity but I'm just getting a black screen on my Mac. It looks like compute shaders might not work well with them.

@inh4les
Copy link
Author

inh4les commented Apr 11, 2021

Make sure you select the slime scene.

This seems to work for most people, just not for me.

@asvarga
Copy link

asvarga commented Apr 12, 2021

I've selected the scene which gives me the black screen. What OS are you on @inh4les?

@amodi04
Copy link

amodi04 commented Apr 12, 2021

I'm getting a black screen too. I'm on windows so it seems it isn't a platform bug

@morgabm
Copy link

morgabm commented Apr 12, 2021

I am on linux with black screen as well.

@SebLague
Copy link
Owner

Sorry to hear the project isn't working for some of you, I'm not sure what is causing this. Something to try though if you're on windows or linux (I've had one person mention that this worked for them): go into the project settings, and under Player > Other Settings, uncheck Auto Graphics API for the relevant operating system, and then add Vulkan from the drop-down list. Finally drag it to the to be the first in the list. You'll then be prompted to restart the Unity editor. Please let me know if that helps.

If you're getting any errors or warnings in the console could you also please paste them here.

@amodi04
Copy link

amodi04 commented Apr 12, 2021

Hi Sebastian,

I tried changing the graphics API to Vulkan (am on windows) but still I get a black screen when running the slime scene. I'm also not getting any errors in the console

@BillPepper
Copy link

@SebLague Thanks, this fixed it for me on Linux with Nvidia.

@amodi04
Copy link

amodi04 commented Apr 12, 2021

If i check Show Agents Only, I see the agents moving around

@SebLague
Copy link
Owner

@BillPepper Happy that fixed it for you!
@IntelligentCake04 That's interesting... I'm not sure what the cause is, but I'll try figure it out.

@khalosh74
Copy link

@SebLague Thanks, this fixed it for me on Windows with Nvidia.
image

@amodi04
Copy link

amodi04 commented Apr 13, 2021

@SebLague I tested the project on another pc and the project worked straight away on that so I'm not really sure what's going on. I hope this helps your investigation.

@asvarga
Copy link

asvarga commented Apr 13, 2021

If I set the Trail Weight to 100, I can see things. I'm not sure what the cause of the inconsistency is though.
Screen Shot 2021-04-13 at 12 48 17 PM

@Owl-In-Bowl
Copy link

Hi @SebLague ,
Thanks for sharing this wonderful code, and for the video show ! It is really appreciated !

I'm unfortunately in the same situation as @IntelligentCake04 (seeing agents moving only with the "only agent - on" and running with the vulkan API). But no slimes in the petry dishes.

I'm running the scene on a Windows 8 laptop with a GPU nvidia geforce 740M (wich technically support DX11 and shaders 5.0)
To identify the source of the trouble, i could try to run an other scene that involves compute shaders.
But, knowing nothing about it, i don't know where to start.
Thanks again for sharing your work
Cheers

@asvarga asvarga linked a pull request Apr 13, 2021 that will close this issue
@amodi04
Copy link

amodi04 commented Apr 14, 2021

@asvarga I tried your fix but I am still having issues, so then I factory reset my pc (i know a bit extreme), but still a black screen. This could possibly mean that this is to do with hardware in which case I'm not sure what to do. @SebLague hope this helps with you're investigation.

@asvarga
Copy link

asvarga commented Apr 14, 2021

My "fix" isn't quite correct, but I still think it is a concurrency issue caused by multiple threads trying to unatomically increment the sameTrailMap pixel with:

float4 oldTrail = TrailMap[int2(newPos)];
TrailMap[int2(newPos)] = min(1, oldTrail + agent.speciesMask * trailWeight * deltaTime);

Different platforms support atomicity differently, so for some of us, this causes only 1 agent to do an increment and the results to be invisible. @IntelligentCake04, does increasing "Trail Weight" fix it for you?

@amodi04
Copy link

amodi04 commented Apr 14, 2021

@asvarga no it doesn't fix it for me. I genuinely think it could be lack of support for older hardware. For reference i am using an i7-2600k and a Nvidia GTX 770. It would be interesting to see a correlation between older hardware and this issue.

@inh4les
Copy link
Author

inh4les commented Apr 20, 2021

@IntelligentCake04
am running a GTX 760, so it's possibly a hardware issue. Right now im running into an issue where it says that the program has compilation errors? This is interesting because I was able to open the project previously. my specific issue is "the type or namespace NUnit could not be found". I tried reinstalling unity, but it hasn't fixed it. Will do some troubleshooting in the meantime.

@bootzin
Copy link

bootzin commented Apr 25, 2021

I'm also being thrown into safe mode when I first load the project. Running on a 2070s, so it shouldn't be a hardware problem

@EbrahimMomin
Copy link

@SebLague can u turn it into a exe file? It would be easier to run than

@bootzin
Copy link

bootzin commented Jun 23, 2021

If anyone is interested, I've recreated the project using my own custom engine here. There is an exe available in the releases with various customizable settings that you can adjust.

@ThoreHaupt
Copy link

Im a total beginner, but I noticed something: I can only have a limited number of actors, to be precise not more than 1048560, which is almost the amount of bytes one MB has (1048575). If I have more I also get blackscreen. (Running on a GTX 1050Ti)
Then I looked into the profiler and if I increased the amount, my GC Allocated in Frame spiked. So you might get it to work on the older hardware if you reduce the number of agents and the size of the image.

@kheremos
Copy link

kheremos commented Sep 9, 2021

@asvarga your fix was pretty close. You were definitely correct on one possible issue. One clue is when you look at the compiled shaders, you'll see the following lines:
writeonly layout(binding=1, rgba32f) highp uniform image2D TrailMap;
readonly layout(binding=2, rgba32f) highp uniform image2D ReadTrailMap;

However, I still can't get it to run on my pixel tablet. So I can't be sure that this is the exact issue that's preventing it from working for others.

Update:
Making this an update because I didn't want to ping anyone.

Finally going to move on. I've explored a wide variety of possibilities, refactored the code a few times. Learned a lot, but not how to get it to run properly under gles3.

For those who come after, consider attempting to leverage HDRP macros but I couldn't get them to work.

@wes-kay
Copy link

wes-kay commented Aug 6, 2023

image

I opened the sample scene Scenes/Slime and was getting the same as you guys, I noticed the camera was rendering but I just deleted the scene camera and made a new one, and it's fixed, no updates to Vulkan or any other settings needed.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.