#StackBounty: #unity #shaders #linux #water Water shader in Unity3D not working on some Linux distributions?

Bounty: 50

I’ve got reports from some Linux users that the game’s water isn’t rendered on his machine.

2 example operating systems:

  • Ubuntu 20.04 (with kernel 5.4.0-54-generic x86_64
  • Linux 4.15 Linux Mint 19.2 64bit

I use this shader: https://roystan.net/articles/toon-water.html

I’ve made a small change so I can use it in orthographic projection as well:

            float existingDepthLinear = 0;

            if (unity_OrthoParams.w > 0)
            {
                // orthographic camera
            #if defined(UNITY_REVERSED_Z)
                existingDepthLinear = 1.0f - existingDepth01;
            #endif
                existingDepthLinear = (existingDepthLinear * _ProjectionParams.z) + _ProjectionParams.y;
            }
            else
            {
                // perspective camera
                existingDepthLinear = LinearEyeDepth(existingDepth01);
            }

            // Difference, in Unity units, between the water's surface and the object behind it.
            float depthDifference = existingDepthLinear - i.screenPosition.z;

What could cause this issue? Feel free to ask for more info, maybe I can provide.

enter image description here

enter image description here


Get this bounty!!!

#StackBounty: #18.04 #unity #mouse #system Mouse clicks do not work for native ubuntu apps or when open folder/file from third-party apps

Bounty: 50

I can not open files or folders from apps like rstudio, typora or chrome. As shown below, when I click "open folders" from typora, the dark grey box will pop up. However, all the buttons do not respond to mouse click except the ‘Cancel’, so that I can not switch folders or select a file.

enter image description here

Similarly, when I open the settings from top menu bar, all the buttons do not respond except the option to close it. If I move the window, it appears as follows:

enter image description here

Restart will temporarily solve the problem. But It will start behaving like this again several days later.

I can’t find a solution on the web. Any help is appreciated.


What I have tried:

I renamed .gnome .gnome2 .gconf (the other two folders were not found) following this link.

Clear cache following this link.


Get this bounty!!!

#StackBounty: #unity #gnome #themes #gnome-shell-extension Change text color for OpenWeather Gnome Extension

Bounty: 50

Problem

I installed the OpenWeather extension from OpenWeather – GNOME Shell Extensions.
Everything is working fine except the text color(see image 1).

How do I change it to look like the calender (see image 2).


I have following extensions installed:

amey@ameypc:~$ ls ~/.local/share/gnome-shell/extensions/
dash-to-dock@micxgx.gmail.com
unlockDialogBackground@sun.wxg@gmail.com
user-theme@gnome-shell-extensions.gcampax.github.com

Additionally, I have set themes’ in GNOME Tweaks tool as

Applications: MacOS-Dark-5.2-dark
Cursor      : DMZ-White
Icons       : Cupertino-Catalina
Shell       : MacOS-Dark-5.2-dark

openweather_issue_extension

openweather_issue_Calender


Get this bounty!!!

#StackBounty: #unity #resolution #screen #screen-management Get all supported resolutions for a monitor

Bounty: 50

I’ve been receiving complaints from users that my game doesn’t support the 16:10 aspect ratio.

Currently I list everything in Screen.resolutions in a dropdown and allow the user to pick from that. I have since come to the understanding that the first element is not necessarily the native resolution of the monitor.

I’ve found the Display class but this appears to only give the native resolution, not all scaled resolutions. E.g. if the monitor is 1920×1080 then I need a list of 1600×900, 1280×720, 640×360 etc.

I thought about just multiplying by some scale factor but then I’m afraid I’ll get something obscure like 885×497.8. And if I have a pre determined list of resolutions for a specific aspect ratio, how do I support obscure aspect ratios like widescreen for example.


Get this bounty!!!

#StackBounty: #unity #data-structure #text #localization How to store and update presentation strings describing effects with parameters?

Bounty: 50

Consider this spell:

Drain Life

As you can see in my design a Spell is a composition of one or more Effects. An Effect has properties on it like value, range, etc. So, I can say that the Spell Description is an aggregate description of the composition of effects.

Presentation Layer

In my presentation, I want to decorate part of the description string in HTML tags and display as rich text. I also want to ensure that my string’s numeric values come from data.

Solution 1

Simply hard code the string. In this case the spell description would look like: Choose a target within <#f4b350>4</color> squares. Deal <#f33613>4</color> damage to that target and restore your HP by <#3cf73c>50%</color> of the damage done.

This approach has some obvious issues, namely:

  • Changing the color value of a particular tag would be a nightmare when there are hundreds of abilities
  • Changing the damage value of a spell means updating it in two places, the string and the data

Solution 2

Create a tag series separated by _ that indicates various properties. I could for example, do something like Deal {subtractive_value} damage to that target with the idea that when I go to parse the string, subtractive could be a tag indicating a red color, and value can be a tag indicating that its the effect’s value that should go there.

This is all fine except that a spell can have multiple effects. I need a way to associate the part of the description with the specific effect that drives it.

Modification to Solution 2

So then I suppose I could just add IDs to the spell effects such that the string defined in data becomes:

Choose a target within {neutral_damageEffect_range} squares. Deal {subtractive_damageEffect_value} damage to that target and restore your HP by {additive_healEffect_value}.

But now you see that its getting a bit cumbersome and I’m dubious of how scalable that solution is.

Non-Goal

Lastly I figured I’d mention a non-goal. If you take my approach thus far to its ultimate conclusion, you would probably end up with trying to find a way to generate your description text from the effect themselves. While this is an interesting idea, I think it’s a bit too ambitious, so I’m specifically not trying to do that. That said, if you feel like that’s easier than I think it is, feel free to make that suggestion!

Question

So, given what I’ve tried and the problem I’m trying to solve, there’s no way this is a unique problem to me. Is there a battle-tested solution to this problem? What’s a good way to go about it or some patterns to use I might not know about?

EDIT

Some have asked for some code, it is lengthy though so I can just link to a gist here:
https://gist.github.com/jsandersr/ef6d560ad95f1d63b1f8e3b2099038a5


Get this bounty!!!

#StackBounty: #unity #c# #python How to make Unity' hidden dot folders visible?

Bounty: 50

My problem is that I have some plugin files inside a folder ".lib" that I need to read in my script, I keep getting errors because the script can’t find the ".lib" folder.
Apparently unity hides folders that starts with a dot.
is there a way around this ?.

Edit :
I’m running a python script using ironpyton, I got some packages in the project, the error happens when it gets to import ‘python package name’ in the python script, due to the missing folder, I can clearly see the folder ‘.lib’ in the file explorer but completely invisible in the project. to clarify things I didn’t set the path manually, one of the python packages causes this error when it can’t find the folder.

the error I got in the console :

OSException: cannot load library C:UsersSaiDocumentsWorkUnityUnity-Python-Demo-masterAssetsStreamingAssetsLibsite-packagesnumpy.libslibopenblas.SVHFG5YE3RK3Z27NVFUDAPL2O3W6IMXW.gfortran-win32.dll

This is my code :

        var engine = Python.CreateEngine();
        ICollection<string> searchPaths = engine.GetSearchPaths();
#if UNITY_STANDALONE_WIN
        searchPaths.Add(Application.dataPath);
        searchPaths.Add(Application.dataPath + @"StreamingAssets" + @"Lib");
        searchPaths.Add(Application.dataPath + @"StreamingAssets" + @"Libsite-packages");
        engine.SetSearchPaths(searchPaths);
        dynamic py = engine.ExecuteFile(Application.dataPath + @"StreamingAssets" + @"Pythonpt.py");
        test = py.CTScan("Codemaker"); //"Codemaker"

My python script :

from time import sleep
from System.Collections.Generic import *

import scipy



class CTScan():
    COLORS = {
        "sick": "rgb(176,55,55)",
        "healthy": "rgb(128,128,128)"
    }

    OPACITY = {
        "sick": 0.3,
        "healthy": 0.2
    }

Folder is visible in the file explorer

Same folder not visible from inside the project


Get this bounty!!!

#StackBounty: #unity #c# #python How to make Unity' hidden dot folders visible?

Bounty: 50

My problem is that I have some plugin files inside a folder ".lib" that I need to read in my script, I keep getting errors because the script can’t find the ".lib" folder.
Apparently unity hides folders that starts with a dot.
is there a way around this ?.

Edit :
I’m running a python script using ironpyton, I got some packages in the project, the error happens when it gets to import ‘python package name’ in the python script, due to the missing folder, I can clearly see the folder ‘.lib’ in the file explorer but completely invisible in the project. to clarify things I didn’t set the path manually, one of the python packages causes this error when it can’t find the folder.

the error I got in the console :

OSException: cannot load library C:UsersSaiDocumentsWorkUnityUnity-Python-Demo-masterAssetsStreamingAssetsLibsite-packagesnumpy.libslibopenblas.SVHFG5YE3RK3Z27NVFUDAPL2O3W6IMXW.gfortran-win32.dll

This is my code :

        var engine = Python.CreateEngine();
        ICollection<string> searchPaths = engine.GetSearchPaths();
#if UNITY_STANDALONE_WIN
        searchPaths.Add(Application.dataPath);
        searchPaths.Add(Application.dataPath + @"StreamingAssets" + @"Lib");
        searchPaths.Add(Application.dataPath + @"StreamingAssets" + @"Libsite-packages");
        engine.SetSearchPaths(searchPaths);
        dynamic py = engine.ExecuteFile(Application.dataPath + @"StreamingAssets" + @"Pythonpt.py");
        test = py.CTScan("Codemaker"); //"Codemaker"

My python script :

from time import sleep
from System.Collections.Generic import *

import scipy



class CTScan():
    COLORS = {
        "sick": "rgb(176,55,55)",
        "healthy": "rgb(128,128,128)"
    }

    OPACITY = {
        "sick": 0.3,
        "healthy": 0.2
    }

Folder is visible in the file explorer

Same folder not visible from inside the project


Get this bounty!!!

#StackBounty: #unity #c# #python How to make Unity' hidden dot folders visible?

Bounty: 50

My problem is that I have some plugin files inside a folder ".lib" that I need to read in my script, I keep getting errors because the script can’t find the ".lib" folder.
Apparently unity hides folders that starts with a dot.
is there a way around this ?.

Edit :
I’m running a python script using ironpyton, I got some packages in the project, the error happens when it gets to import ‘python package name’ in the python script, due to the missing folder, I can clearly see the folder ‘.lib’ in the file explorer but completely invisible in the project. to clarify things I didn’t set the path manually, one of the python packages causes this error when it can’t find the folder.

the error I got in the console :

OSException: cannot load library C:UsersSaiDocumentsWorkUnityUnity-Python-Demo-masterAssetsStreamingAssetsLibsite-packagesnumpy.libslibopenblas.SVHFG5YE3RK3Z27NVFUDAPL2O3W6IMXW.gfortran-win32.dll

This is my code :

        var engine = Python.CreateEngine();
        ICollection<string> searchPaths = engine.GetSearchPaths();
#if UNITY_STANDALONE_WIN
        searchPaths.Add(Application.dataPath);
        searchPaths.Add(Application.dataPath + @"StreamingAssets" + @"Lib");
        searchPaths.Add(Application.dataPath + @"StreamingAssets" + @"Libsite-packages");
        engine.SetSearchPaths(searchPaths);
        dynamic py = engine.ExecuteFile(Application.dataPath + @"StreamingAssets" + @"Pythonpt.py");
        test = py.CTScan("Codemaker"); //"Codemaker"

My python script :

from time import sleep
from System.Collections.Generic import *

import scipy



class CTScan():
    COLORS = {
        "sick": "rgb(176,55,55)",
        "healthy": "rgb(128,128,128)"
    }

    OPACITY = {
        "sick": 0.3,
        "healthy": 0.2
    }

Folder is visible in the file explorer

Same folder not visible from inside the project


Get this bounty!!!

#StackBounty: #unity #c# #python How to make Unity' hidden dot folders visible?

Bounty: 50

My problem is that I have some plugin files inside a folder ".lib" that I need to read in my script, I keep getting errors because the script can’t find the ".lib" folder.
Apparently unity hides folders that starts with a dot.
is there a way around this ?.

Edit :
I’m running a python script using ironpyton, I got some packages in the project, the error happens when it gets to import ‘python package name’ in the python script, due to the missing folder, I can clearly see the folder ‘.lib’ in the file explorer but completely invisible in the project. to clarify things I didn’t set the path manually, one of the python packages causes this error when it can’t find the folder.

the error I got in the console :

OSException: cannot load library C:UsersSaiDocumentsWorkUnityUnity-Python-Demo-masterAssetsStreamingAssetsLibsite-packagesnumpy.libslibopenblas.SVHFG5YE3RK3Z27NVFUDAPL2O3W6IMXW.gfortran-win32.dll

This is my code :

        var engine = Python.CreateEngine();
        ICollection<string> searchPaths = engine.GetSearchPaths();
#if UNITY_STANDALONE_WIN
        searchPaths.Add(Application.dataPath);
        searchPaths.Add(Application.dataPath + @"StreamingAssets" + @"Lib");
        searchPaths.Add(Application.dataPath + @"StreamingAssets" + @"Libsite-packages");
        engine.SetSearchPaths(searchPaths);
        dynamic py = engine.ExecuteFile(Application.dataPath + @"StreamingAssets" + @"Pythonpt.py");
        test = py.CTScan("Codemaker"); //"Codemaker"

My python script :

from time import sleep
from System.Collections.Generic import *

import scipy



class CTScan():
    COLORS = {
        "sick": "rgb(176,55,55)",
        "healthy": "rgb(128,128,128)"
    }

    OPACITY = {
        "sick": 0.3,
        "healthy": 0.2
    }

Folder is visible in the file explorer

Same folder not visible from inside the project


Get this bounty!!!