Translucent material/shader - unity3d

I want to achieve this result.
Light passes from thin areas of object (lower density) and cannot pass from higher density areas.
Is it possible? I also want to export it as WebGL to use it in web App.

I never tried myself but as far as I know it's possible. I've come across this post before:
http://www.farfarer.com/blog/2012/09/11/translucent-shader-unity3d/
It's a bit old but it may be a good starting point. There's a link to an old GDC presentation as well explaining a bit how this stuff works which may be helpful.
If I'll ever going to have the freetime I'll try it at home, sadly the coming holidays kept me away from working with Unity recently.
Hope this helps.

Related

Have you had user specific bugs with Unity builds that you have sent out

I have a build which I send out to players and 50% of them get different unique bugs, where Stats reset, Array values match up differently, Certain attributes increase by zero.
This only seems exclusive to their computers and are all very different.
I've attempt sleep nights trying to replicate these bugs on multiple computers, but it I cannot replicate it.
The other 50% of players (Although I don't the actual ratio)
The build works fine, all the bugs and issues that occurs are ones that I know about and easily fix.
I'm desperate to know what's going here, if its something in player settings like changing .NET 2.0 to 4.0 or something like that, but honestly I'm not so well experienced in that area.
Playmaker is mixed into the project for arrays and simpler things, but I've scoured the forums and I can't find anything related to that.
Maybe I need to upgrade my version of unity?
I'm on Unity 2020.1.1f1 Personal, if that has anything to do with how the game builds, but at this point I'm just throwing punch's in the dark.
Thank you.
I also use Playmaker and I've recently experienced a similar bug.
It turns out different CultureSettings on users were causing the issue.
Try this:
using System.Globalization;
and
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
Wish you a great weekend :)

How to avoid Unity Complie all Standard shader variants

When add Standard Shader to Graphics——Always Include Shaders, Unity always stucks in sharedassets0.asset. I know it's unity complies shader variants in the background. it's about 60000 variants which make the .apk size is triple bigger than normal size. And it takes a long time(a couple of hours) to build, even if an empty project.If I remove the shader from the list, when I load a model from asset bundle, it will be a pink.Only add Standard to the list, then everything is ok!Is there any way to solve this problem? Please help me!I googled all I can google!
Edit: Unity 2018.2 added IPreprocessShaders which is described at:
https://blogs.unity3d.com/2018/05/14/stripping-scriptable-shader-variants/ You can review each individual shader keyword combination in IList<ShaderCompilerData> and remove ones you are certain you don't need. The this API is not complicated, but standard shader keywords are not well documented. Some of the keyword correspond to enum BuiltinShaderDefine while others are not. I ended up using this preprocessor to remove any ShaderCompilerData with BuiltinShaderDefine.UNITY_HARDWARE_TIER1, BuiltinShaderDefine.UNITY_HARDWARE_TIER2 and INSTANCING_ON(This is not in the BuiltinShaderDefine enum) turned on since I am certain we didn't use quality settings toggle and instancing.
The Unity Shader Variant Collections works kind of wonky. I ended up using a plugin called "Shader Control" to clean up the mess. But the process is still far from enjoyable since when you remove a keyword there is a chance you break something.
The best solution I could think of is remove all the "Built-in Shader" (Maybe not "Deferred" is you are using Deferred Rendering) and "Always Include Shaders" at the beginning of the project and if someone needs a built-in shader, download "Builit in Shaders" from the Unity Download Archive and import only the one needed back to the project. So that you can:
Have 100% control over built-in shader
Only compile shaders you used
Avoid shader duplication in AssetBundles (If you pack something referencing default imported shaders, the shader will be duplicated for each AssetBundle)
But this "best solution" is certainly more of a hindsight and does not help your current situation though. Give Shader Control a try.
Hi I want to suggest a method that worked for me. I was going to comment but my reputation hasn't reached 50. I would not recommend this as answer but no harm for you in trying I guess.
Instead of including the shaders under Graphics——Always Include Shaders I went to Project Settings -> Player -> Optimization and included the shaders under Preloaded Assets.
I also have doubts if it is the correct way to do so but it solved my problem. I would be glad if anyone could point out what was wrong about it and explain a bit, as I could not find much reference to this method on the Internet.
I have posted a similar question at game dev stack exchange
https://gamedev.stackexchange.com/questions/190092/unity-2020-3-what-is-best-practice-to-include-shaders

Tracking a 2 dimensional sprite in Java

I'm kind of new to this whole thing but I'll get started by asking my first question ever.
So a friend and I are working on a project in which we need to track the player character's head movement and attach items to it. Now is this something that needs to be done in Java or would this be something that would be done in Unity?
Sorry if this is a stupid question but I've never really worked on a project of my own volition before.
Thanks,
BadAssWalrus
Ok, so first things first. There is no java in unity, you can do scripting in C#, UnityScript (essentially JavaScript) or Boo.
Now to answer your question, according to my understanding you want to move some objects as the head of the character moves. Now depending upon how you are really trying to move the objects you could either do it with scripting or simply by making the object you are trying to move a child of the head of the character.
Unity has excellent documentation about the scripting API and a lot of tutorials. I suggest you get started by looking at one of these tutorials, and you should get an idea of how things work pretty soon and then you should be able to do pretty much anything you want to do with relative ease.

Portal effect/Non euclidean

I am looking for a solution to the effect used in Valve's portal games and seen in the "portalizer" unity package. I have searched almost every related question on many forums, however none seem to offer the help I need. I have tried re-working the mirror reflection script found on the wiki, however I have a lot of problems when they are out of the camera's view, and it never seems to work. I feel like I have spent hours on this, if you know anywhere which details the logic and explanation of this effect such as camera matrices and stuff it would be great, or just a working block of code for me to look through.
By the way i'm actually not hoping to explicitly use it for potals, Im attempting to make a room similar to Doctor Who's Tardis which is bigger on the inside, kind of mimicking the effect of Non-Euclidean space. Im also looking for something more advanced than a simple camera with render-to-texture. Im also using the pro version.
Thanks in advance.

Cocos2D game tutorials/game suggestions

I use Ray's link to learn Cocos2D, any other good links or tutorials I can use for developing?
Any suggestions about game developing?
Since you weren't too specific on what kind of links you wanted...
This is a bit philosophical but helped me stay focused on getting some simple games finished and polished rather than leaving them half done and moving to the next thing:
http://makegames.tumblr.com/post/1136623767/finishing-a-game
Here's a ton of links to all sorts of game related topics:
http://www-cs-students.stanford.edu/~amitp/gameprog.html
For cocos2d I'd suggest grabbing the full source code and opening up the cocos2d-ios workspace and then compiling and running all the test applications. They'll let you see a bunch of cocos2d's capabilities and give you a starting point to answer those "How would I do X..." type of questions. So after running the TileMapTest you'll know the different type of modes (ortho, iso, etc) it supports and know that there's sample code you look at to get it working.