I am working on game in unity in which i need some images to be placed on terrain as in the attached image yellow arrows and "P in blue circle" are rendered on surface in unity.
Any idea or method will be appreciated.
There's no built-in support for decals in Unity. You could just create separate gameObjects with transparent texture and place them above the terrain here, or use one of several packages for decals in Unity Asset Store, like this one. (I have only briefly tried it and can't say anything about it's quality).
I know it's an old topic - but for those who are still not satisfied:
I would recommend using Easy Decal.
It's a very powerful decal projector. It's easy to use and you can stick decals also on uneven surfaces like bumpy terrains.
You could try putting a plane with the texture aligned with the surface normal slightly above the surface. Or you could try an extension that does decals for you. This is what i found:
Decal System for Unity3D
As previously mentioned Easy decal is a good choice. It's easy to use, has extensive fuctionalities and you'll get a lot for your money. But if you need skinned decals there's no way around Decal System Pro by Edelweiss interactive. It's more expensive, but beside the skinned mesh support it also supports texture atlases which saves you draw calls.
Related
I produced a hightmap from a digital land model and placed it as a terrain into unity. How can I put an arial photograph on it?
Any hints are welcome!
Andreas
You can do this by using the terrain splatmap, in Unity i think it is called alphamap.
Doc available here: https://docs.unity3d.com/ScriptReference/TerrainData.html
Please note that one splatmap can only store 4 textures, so if your arial photograph contains more then 4 different texture types you will need to think in arrays of splatmaps.
If this method does not fit your needs then you need a projector or decal method, read about them.
Alternative way:
If you dont need any runtime magic, you can just add a texture, to your terrain, this texture will be your arial map, and basically fit this onto your terrain. But one texture on large terrains would produce quite bad results imo.
You can do this by generating a mesh procedurally, and setting the UVs according to the size of the image file.
Look up "procedural mesh UV unity"
I'm having trouble figuring out how to light up large area(s) of sprites in Unity 2D. My previous knowledge on Unity's lighting is zero.
I first tried using a large amount of point lights and using the "Sprites/Diffuse" material, but about only five would actually render at a time, so I guess there's a limit on that.
Then I tried putting in an area light. That didn't do anything, so that's when I started doing research about baked lighting on sprites (and baked lighting in general). I found stuff like this but I couldn't get it to work either because it's outdated or because I don't know what I'm doing. Other answers I've come across seem to assume that the reader knows anything about lighting in Unity in the first place which, to be honest, I don't. Unity's documentation website had some information on it, but no tutorials that go into how to set up baked lighting.
I've tried a bunch of different combinations of materials (like using the "Standard" shader for the sprites instead of "Sprites/Diffuse", emission, ect.) and I enabled "Baked Global Illumination" in Lighting>Settings.
If baked lighting isn't possible on sprites (or isn't worth the trouble), what are the alternatives?
Edit: I made sure not to have the lights pointing the wrong direction, and I do realise that Unity2D is just like painting onto a piece of paper in Unity3D. I was able to get point lights to work, but only a few at a time. I don't need to do the entire screen at once, I need to do a large specific area at once.
some tips...
working with sprites your in 2d... when you add a light, switch to 3d mode, and rotate to make sure your light is pointed at your objects, and oriented so as not to be on the same plane, or level with them, as this will cast all the light behind them.
if your trying to light up everything on the screen(in camera) attach an area light to the camera at the cameras position, point it where the camera points, and then in the inspector on the right, you can change its variables. intensity, range, width, height etc.
Emissive Texture:
https://www.youtube.com/watch?v=oa6kW5HhRd4
For some reason, I never even thought about going into the asset store. I found this for free, and it looks like it will work: Light2D.
Imagine you have some Unity3D Terrain using their Terrain system.
So, imagine 3 or 4 acres of just brown dirt or white snow.
Imagine you want to add some markings, some painting on the Terrain - detail stuff.
A good example is those blue lines they use on ski runs:
How the heck would you add those blue lines to Terrain?
And unfortunately it needs to work in VR.
You could use projection I guess, or decals, but that's hokey. Decals would be a pain unless flat surface (but maybe there's a technique for making "shape matching decals" or the like? IDK)
You're looking for decals
Not much to say on this, other than, yes, you want a decal system.
There are decal systems that can only render flat decals (and those do tend to be more performant) but that isn't the only way to do decals.
I've worked with Simple Decal System before, it's what's running the decal I used in my comment. I won't say it's a great system, but it is free. It is possible that UV Paint is better at $50, but I don't know.
In older games Ive made levels in, like unreal or half-life the skybox is a parallaxed texture that you assign to world geometry, for instance, the ceiling of your room, to give the illusion of the room being open to the sky.
There are some neat tricks or weird things you can achieve with this 'sky portal' method. For example you could have 'sky' in an underground room. or walk through a hole in the sky.
I'm wondering is it possible to make a mesh in unity3d render as part of the skybox like in these older engines.
You can do this yes. Usually you assign a "SkyBox" to your camera and change the "Clear Flags" for her "SkyBox". However, there are other ways to do.
Learn more here: http://docs.unity3d.com/Documentation/Components/class-Skybox.html
Hope this help !
I've been trying to get my head around how to do a player vision like what is in Teleglitch (If the player can see the objects they're shown, otherwise it's black).
(gameplay from Teleglitch : http://www.youtube.com/watch?v=0OBXdEwawqI)
I am currently developing an turn-based strategy game where I would like this feature. Problem is that I actually have the Vision Cones already but I am not sure how I would go about doing this.
I've seen some guides around to do the vision cones, how do I actually apply the "darkness"?
I have a feeling that the best way would be a shader, but I can't seem to find what I am looking for.
Thanks
In Teleglitch, it looks like they simply render black polygons over the shadow areas. Another approach in Unity is to use depth masks. Unity 4.2 Pro also supports stencil buffers which are useful for masking effects.