i have a 2d plane that is generated thru script and i need it to have a material on it that will work as a light.
What i am doing is having a side scroll game with a generated 2d torch which is the plane, now the environment color and the skybox are pitch black and my 2d torch needs to light up the background that is 3d so far i have gotten almost desirable effects with a particle additive material however the contrast is weak and will not help if the environment is black.
will i need to develop my own shader as i have never done this before id prefer not to or is there a simple material solution that i can use.
i am using unity3.55 free
A particle system won't light anything up. Your only out-of-the-box solution is a pixel point light.
Related
I am creating a game that uses 2D sprites in 3D terrain. I am using Universal Render Pipeline and 2D renderer to use 2D lighting. These 2D objects are placed on 3D terrain to create a game similar to "Don't Starve Together" where everything is at an angle so it creates an illusion of 3D space of 2D objects.
To be able to use 3D terrain with the 2D renderer, you need to convert every single material and texture, this is done easily. For the terrain to work, you need to create new material and attach a URP shader to it (Universal Render Pipeline - Terrain - Lit). And here comes the problem, the terrain is suddenly completely invisible and I am not able to paint on it. According to tutorials, this should work perfectly fine and in the videos, it does.
After 2 days of searching, I found nothing so I had to think of my own ideas. I have got one that is not working. My question is if you have seen some similar problem before and know how to solve it, how to solve that material issue, or how to be able to get my idea working.
Idea:
I have got an idea if it is possible to use 2 cameras at once, one that would be using a 2D renderer on 2D objects and a second one that would be using URP renderer for the terrain. The terrain now has a terrain layer. The one with the 2D renderer ignores the terrain layer and the one with the URP renderer ignores everything except the terrain layer. But for some reason, it still is not working.
Any help would be appreciated. I would have provided pictures but the servers are broken again.
I am planning on making a city building game in the vein of SimCity 2000 and Zeus in Unity. While looking at Unity's Terrain component and its experimental terrain API, I was under the impression that it would be trivial to paint texture over Terrain at runtime considering it is easily done in Editor, but it turns out it's not.
What's the approach to painting road or any texture over Terrain at runtime? Can it be achieved using Unity's Terrain and its API? How did these old games implement this?
I am aware of assets in the Unity Asset Store which can be used to achieve this, but I am looking to learn the underlying concept.
I imported an image instead of a 3d model for am enemy, and the game is supposed to be in dark at night but the image is not blending with the rest of the environment so can anyone plz help.
If it is set to sprite it uses an unlit shader that does not respond to lighting. If you have it on a material as the albeto channel on a 3D plane, it will respond to lighting but only as a flat surface. Unless you also have a normal map for it.
I am trying to build a VR applications with portals into other worlds. These portals do however not have to be flat, they can be bent. Here https://www.youtube.com/watch?v=EpoKwEMtEWc is video from an early version.
Right now, the portals are 2D planes with camera textures which stretch and move according to the users position. For VR use, and to ease performance issues, I would like to define which area of the screen gets rendered by which camera. Sort of like a viewport in regular Unity, but not rectangular, and for VR with Windows Mixed Reality.
Is this somehow possible? Possibly even without Unity Pro?
Novice Unity user. I want to create a pixel art 2D RPG game for fun in unity. I ran into an issue with my pixel art when I would drag it into the scene window. What would happen is that the Game Window would distort the pixel sizes to be either twice as wide or twice as narrow in the x and y direction. I have no clue on how to fix this issue and looked all over. I would appreciate any feedback. But I would prefer a discord call so that I may share my screen to get efficient troubleshooting advice! Thank you
There are quite a few tutorials and even helper packages to deal with Pixel Art games in Unity:
Achieve Crisp Pixel Art with Unity 2018.2
Pixel Perfect Package
Making A Flappy Bird Style Game
By default, Unity will import your images as Textures and resize them to the nearest Power of 2, which should explain the distortion observed.
A bit more advanced, but if you want all the images to import as Sprite, you can save a Sprite import setting as a preset and then assign it to the TextureImporter in Project Setting > Preset Manager. See Reusing property settings and Preset Manager.
hth.