I have a spotlight in front of a mash:
And I would like to see the circle of light also from behind the mash. I would also love to have the light a bit diffused like lighting a piece of fabric.
Any tips about how to achieve this?
Thanks alot!
TL;DR the effect you're trying to achieve is not possible in the manner you're trying to achieve it in.
You've essentially got two or three options here. And you may want more than one of them.
Set the mesh to not cast shadows. This is pretty much the straight forward solution. It's not going to change the...texture of the light ("make it more diffuse") but it will mean that the light will illuminate other objects behind it.
Use two lights. One light will illuminate the mesh and only the mesh. You'll have to use physics layers for this, and layer masks. The second light--which is more diffuse than the first--illuminates everything but the mesh.
Along with #1 and #2, there's a thing called a cookie that might come in handy.
There might be a solution involving custom shaders. Not having explored this in the past myself, I can only say "it is a research direction I thought of." Research it. (Note: Shaders are complicated and Hard).
Writing your own lighting solution. This is probably the most advanced topic I can suggest. By which I mean "this will solve your problem, but keep in mind, there's about 40 years of research already been done to come up with the models we have which don't solve your problem." We only started to get subsurface scattering as an option in the last three to five. Now you want subsurface scattering to affect the light cone for other objects. Sooo...have fun with that.
Related
I'm new to shaders and with the new Shader Graph from Unity I'm trying to experiment and archive some effects that I have in mind for my games.
I want to get something like this:
https://imgur.com/vqy9y3H
I want a glow effect to go arround my object. In my case it's a square neon light, so it's simple I think.
What I have so far, experimenting and unifying different tutorials, effects, etc.:
https://imgur.com/aPW95S0
This is the current Shader Graph, i know its a mess and maybe there are useless nodes, etc.:
https://imgur.com/J3jzGE6
This is the tutorial I think it's the most accurate to what I need:
https://www.youtube.com/watch?v=UJUlGJS3QpY
Thanks in advance for any tip that help me find the correct path to archive the effect.
EDIT:
To make it clear, the real problem for me is the motion effect. I already setup the glow effect with post-processing and bloom. My problem is how to do the effect arround the object. In my case it's a neon tube, so it's easiest I think, as the effect can be on all the object but from the start of the tube to the end. As the tube is closed, it will start again from the begining almost at the same point. Hope it make it clear.
you can use post processing to get the effect your after, specifically bloom and tone mapping effects.
With post processing applied you just need to increase the color into HDR levels in your shader.
Applying a blur outside of post processing is actually extremely expensive and isn't really recommended unless there is absolutely no other option.
so I've been trying to see if I can make use of Wheel Colliders for the past several months now. As much as I've managed to figure out more and more things about how to set them up properly, there's some things I've been noticing that seem impossible to avoid:
Even if your friction sideways stiffness is lower, there's a chance that your car will continue to "spin" or "rotate" in the direction you were steering if you JUST hold down your input long enough to get the car beyond just rotating. I've noticed this will happen, whether for example the "SteerHelper" or "TractionControl" functions are doing their work or not. This will put a dent in ensuring smooth turn movement. Now, I don't know if maybe this is just due to realistic car physics (I mean, I can picture the car skidding in scenarios where they lost grip of the road for sure), but it just feels kinda glitchy. Sometimes, even when I'm not turning, the car will start to turn a little to the left or right and then gradually seem to "lean" that way in terms of applied torque to the rigidbody. I've seen many suggestions for trying to stop the rigidbody from doing this. Here is one way I'm trying to work against this:
rb.AddTorque(-rb.angularVelocity * 2);
However, it seems that the car will still "spin" more than intended. What would be ideal is to be able to MAYBE allow the car to turn a little extra after the left or right steer buttons were released (maybe more or less depending on the vehicle), and no more than that to ensure there is maximum control to give the engaged and maybe arcadey game play I've been going for for a long while.
It's been difficult to adapt an ideal friction curve value that would give the most ideal feel of a drift turn, especially a more arcadey one. I'm not trying to go for wide turns that slow you down, I'm trying to go for tight (yet controllable) turns that allow you to preserve most of your speed. I find that especially at higher values of stiffness, as I know many people have observed in other posts, that again, the car will turn back an extremely high amount sometimes (you drift left enough, a force is turning your vehicle way to the right). It's sad, because I've wanted to be able to say I've "mastered this beast" and used it for my purposes, but I don't know if that's really a good practical expectation for anyone. I even worked my own alternate friction curve values that would be used in the controller:
But I guess as some people say, you can't polish something that's broken? Moving to the third point...
I've read so many posts that show how to adjust a vehicle's center of mass, or to add more colliders in different spots to correct it, using scripting to add an offset to the center of mass, etc. So many tips that say, "lower the center of mass, you'll find it" and I give that a try. When the center of mass is too low, my car can get pretty shaky on the terrain (not that it hasn't in the past, but it's often been things I could correct, like the weird initialization of the attachedRigidBody of the wheel colliders themselves in the beginning, etc). High enough, and of course, (even when it's lower sometimes???) the car will just start spinning in the air on either multiple axes or specifically the forward z, when you drive off a ledge or bump into something with a high enough speed. It just seems inevitable.
I've been trying to give my benefits of a doubt. I like to think there's a correct way to use this thing, and that I'm just not familiar enough with Unity3D physics concepts. However, it just seems more and more that I'm investing too much time in a broken component - or, maybe I just never got the best grip of physics.
I was about ready to try just convex mesh colliders around my tires, and just abandon the idea of gripping physics altogether, but I'd love to hear suggestions to either address anything I've mentioned above, or just a more ideal package to move onto. I've glanced at packages like Vehicle Physics Pro, but I do want to be sure I'm getting something that makes sense.
Full disclosure: I'm in the middle of trying to make a game that feels incredibly similar to F-Zero, but with wheels.
Thanks in advance for any thoughts or suggestions you can provide.
(Maybe not an answer per se, but hopefully helpful.)
Note Unity also suggests to possibly give the car a constant downward force via script. It might be telling that such workarounds are officially given, one would think proper physics would, well, properly work without them.
There's some assets you might want to give a try generally:
One is the Unity Asset Store asset called Arcade Car Physics, and it's free. I've tried it and it works (but not sure if it works for your needs). It's using Unity's native Wheel Collider plus extra scripts.
Another is the Arcade Car Physics github project. It has nice plane stabilization and more, and works well. It's not using the native Wheel Collider.
Then there's this asset called Vehicle Physics. Instead of native Wheel Colliders, they've create a fully custom wheel system so that it would be more physically workable. The asset is not free, but they offer a free demo executable where you can drive around different vehicles, and that works quite well. (I haven't yet bought this asset myself.) As a downside, some reviews mention there's some complexity in setting this up (and I suppose future support for this custom Wheel Collider hinges on the company continuing to exist).
Good luck!
Vertex lights work fine on dynamic objects, but the second I make them static and bake lightmaps they're ignored.
I've tried changing to different "lightmodes" within the shader, but none has worked. Lightmode "ForwardBase" seems to really mess up, even though I would assume its the one to use given its description on https://docs.unity3d.com/Manual/SL-PassTags.html
Any suggestions would be very appreciated :)
My understanding of the question at hand
As I understand, when you bake a lightmap, the only light source that will change the light of the baked objects is a pixel light. But you would like to make it work with a vertex light.
I'm still not entirely sure whether you mean that the light simply won't bake into the baked map in the first place, or whether it cannot affect the light level of the object after it has been baked.
In any case, I did some searching.
Possible solution/explanation 1
When I searched I came across this tool and description.
https://assetstore.unity.com/packages/vfx/shaders/vertex-lit-shader-baked-shadows-realtime-light-75977
By default, using Unity’s built-in shader Mobile/VertexLit lighting
works only as either baked or realtime but you cannot display a
realtime light on a baked surface. This shader allows a baked surface
to also receive realtime lighting.
Note that the tool is free.
Possible solution/explanation 2
I also came across this tutorial: https://catlikecoding.com/unity/tutorials/rendering/part-16/
Where the author writes
When lightmaps are used, Unity will never include vertex lights. Their
keywords are mutually exclusive. So we don't need a variant with both
VERTEXLIGHT_ON and LIGHTMAP_ON at the same time.
Lastly please note that these solutions seem to be developed at earlier versions of Unity. Newer solutions more appropriate may exist.
Hope this helps you.
So i try to make a adventure game and in one point my character need to eat some food and get fatter and fatter, smoothly every second.I've found only one solution in asset store.The MCS(Morph 3D) has this feature.But problem is i don't want to use one of their character.I have my on low-poly 3d character and i want to use this.
This is an example of what i need :
MCS Morph 3D
So where should i start? What should i look in to? Is there simple way to this or is it really hard?
Thanks already :)
This would normally be done with a frag/vert shader. You would modify the vertices of the mesh in the stomach area based on some value. This could be done really simply in which the distance of the stomach vertices from some given point located in the character's core would just increase based on your given value. I believe your thoughts are imagining something much prettier than this, but anything else would be much more involved for something that is purely visual. If you are not experienced with shaders, I would highly recommend purchasing a visual shader editor, such as Amplify (ASE) or Shader Forge. They make the jump into shaders much easier.
I'm trying out the new Version of Unity 3D (5.0.0.4f) and figure out whats new, whats possible now. My experience with Unity 4 free is also just a little.
Anyway I work with the "new" cloth component and have some general questions to different funkctions. The documentation brought no knowledge to me. So I would be thankful if one of you could explain me the different points in an accessible way.
First question touchs the constraints. When I edit the contraints (of a plane for example), there are two options to activate. What are the differents between Max Distance and Surface penetration. max Distance is clear to me but i don't know what the second option does.
Seceond question: I have an tablecloth positioned over a sphere. In playmode when i move the sphere up and the tablecloth react correctly. But the sphere ist temporaliry visible trough the cloth. Its look like a graphicbug then, but ist there a way to prevent this?
So I hope my questions a clear enough to understand. Thanks a lot for your educational effort.