5

Realtime shadow maps allocate texels for everything the light can see. Lightmaps allocate texels for everything. This makes a big difference in several cases: faces occluded from the light don't contribute any information to a shadow map - they occupy the same texels as the object occluding them. A lightmap will allocate separate texels to shadowed faces. ...


3

It looks to me like the problem is related to your texture wrapping. Originally you had GL_TEXTURE_WRAP_REPEAT, which is clearly wrong. You can even see in the original image on the right side, some of the light has bled over. I believe that GL_TEXTURE_WRAP_CLAMP_TO_EDGE is probably what you want. I think something else is going wrong with your second image ...


3

So I recently tried my hand at this and ran into a lot of the same issues you guys have. The render texture solution is a bit of a red herring. I was able to solve it using multithreading pixel manipulation on a separate thread. https://www.youtube.com/watch?v=T_zpFk1mdCI So ordinarily one would use graphics.blit() and pass the render texture in to ...


3

In the past I've fixed this sort of problem using a dilation filter. Basically, the idea is to go over the lightmap after it's rendered and expand the borders of all the pieces by a few pixels, by copying the values of filled pixels into adjacent empty pixels. This can be done with a pixel shader in a full-screen pass or two over the lightmap.


3

First of all, the process of finding the pixels that fall in a triangle is called rasterization. You might want to look up some articles on fast software rasterization, or better yet move the lightmap build process (or at least the rasterization part of it) to the GPU, as it'll be much, much faster. There are two possible solutions to the problem of cracks ...


2

There isn't a way to bake lightmaps at runtime using Beast (Unity's lightmap engine). Beast only works in the editor. However, you can run editor functions from the command line using -executeMethod so if your procedural level was XML you could send it to a server, run an editor method similar to this (javascript): static void PerformBuild () { ...


2

The problem seems to be in finding the lightmap texture coordinates, which I assumed were the same as the face textures. They're not. If we examine the RTCW source code, paying particular attention to the ParseTriSurf function, we see the code for loading lightmap texture coordinates is as follows: for ( j = 0 ; j < 2 ; j++ ) { tri->...


2

Increase atlas size to 4096. [Lighting tab >> Baked GI >> Atlas size] Tested with your settings: Increase bounce intensity of light. Also increase indirect intensity and bounce boost under General GI in Lighting tab. These should be satisfactory. If not put some bake only point lights where shading is not working good. Then bake.


2

Usually, for texture based lighting techniques such as normal mapping and specular mapping, the same set of texture coordinates is used, because the textures are the same, only holding different contents. See this image: The first is the normal map, then the diffuse map (object color), then a couple specular maps. As you can note, they have the same "shape",...


2

Most likely reason is that you have VSync turned on for your game. VSync (vertical synchronization) will only ever work for a game if it's in exclusive full screen (which is what you're doing by maximizing). You can change this setting by using the QualitySettings option for VSync. Taken directly from the link I've provided. This Example() function should ...


1

You have a warning in the next-to-last screenshot which says "This GameObject has overlapping UVs". I also see that you've tried the suggested fix - to check "Generate Lightmap UVs" - but often this, in itself, is not enough to fix overlap because Unity's lightmap generation is not great. To see if UV overlap is indeed the problem in this case, it may help ...


1

I've managed to implement two solutions for my problem. Light baking I set all surfaces where the light pattern was needed to 'Lightmap static'. Then, duplicated both the point light and the ball with cracks (occluder), set them to 'static', set the light's 'Mode' to 'Baked' and the ball's 'Cast Shadows' to 'Shadows Only' (makes the mesh invisible but keeps ...


1

Static lights should use the light map (as they don't change, there is no need to use dynamic resources). Moving lights, should use some form of real-time shadow mapping, which involves doing a sort of quick bake of a custom light map based on what it can "see". This is done by doing a depth map render before the lighting phase, for each light (spotlights ...


1

Here I'm answering my question. copy the following shader and create a new Shader ; Shader "Glow" { Properties { _MainTex ("Texture", 2D) = "white" {} _Color ("Color", Color) = (1,1,1,1) _Glow ("Intensity", Range(0, 3)) = 1 } SubShader { Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "...


1

A simple way to perform a glow, particularly in 2D, is to make a blurred copy of your image and then blend it with the original image. You can use either a normal blend with a 50/50 mix between the original image and the blurred image, or you can use an additive blend. It can be helpful to threshold the original image before blurring it if you want only the ...


1

Yes, Black has a value of 0 for all color components, and your use of BlendMultiply means that anything multiplied by 0 is still 0. Try using a different blend mode -- Additive Blending tends to look reasonable for glow effects like these.


1

As @DMGregory said, I solved this issue to placing reflection probes in there and increase the intensity, is now non-static objects are brighter enough.


1

Lightmap stitching Lightmap seam stitching makes it easy to get rid of those annoying edge seams in lightmaps. Fixed in newer unity version: 2017.2 What's new in Unity 2017.2


1

If you combined your tiny mesh into a big one in code, such as following: Mesh newMesh = new Mesh(); newMesh.name = "CombinedBig"; newMesh.CombineMeshes(combineInstances, false, false); Unwrapping.GenerateSecondaryUVSet(newMesh); // This line is necessary!! meshFilterCombine.sharedMesh = newMesh; You need generate the secondary UVs set ...


1

I just found the issue. For models without Lightmap UVs it's required to generate them. This can be done directly in Unity where you just have to tick "Generate Lightmap UVs" in the Model tab of the imported model. Don't forget to apply the changes made to the import settings! I did this with all of the affected models and it solved the problem.


1

Conservative rasterization is a fix for this problem. Thanks to Nathan Reed's comments, in preparation for the generation of a lightmap, I dilate the uv coordinates and recalculate they're associated positions based on the dilation. For each triangle: Compose an array of edges in uv space. For each edge: a. Compute the cross product using the edge ...


1

The lightmap shouldnt be dissasociated from the vertex information. if the vertices are lined up to display no cracks and no rounding errors coming from the CPU (i.e. object positions + vertex positions interpolation) they they won't let anything through, the edges have to be aligned and no triangle intersections. If the mesh doesnt have cracks, nothing ...


1

I highly recommend using HDR and tonemapping to get lighting under control. For a somewhat realistic render your lights are supposed to be set quite high. You then use tone mapping to bring all the lightning back under control. You didn't mention what platform you are targeting. If it is Desktop or Webplayer then tonemapping is the way to go.


1

Create a lightmap in your 3D-modeling-program (e.g. blender). Load it into your game without changing the object's UV-coordinates Make your game multiply the diffuse-texture with the lightmap.


1

One solution is to use Lightmap Manager 2 Also, a recent update to Unity (sorry, can't remember if it was 4.1 or 4.2) exposed some additional lightmapping methods in the API which help with this.


1

The dilatation will seem to work, but it is an imperfect solution because it is undersampled, it re-uses information (entropy coming from light irradiance samples) and spread it over, effectively creating extrapolation. The correct thing to do here is to use conservative rasterization which is not trivial at all to do. Your rasterization is based on the very ...


1

You could use LightProbes. Create a Light Probes Group from the editor. When you bake the lightmap it will be populated with info on the various light sources. If your combined model MeshRenderer are receving probes (check Use Light Probes in the inspector), then the shader can calculate approximated lighting coefficients sampling them from the probes ...


1

There is a skybox shader that blends between two sets of skybox textures. Think day and night cycle! If you want to build or animate the skybox from script, use skyboxmaterial.SetFloat("_Blend", yourBlend) to change the blending; can also use SetTexture material functions to setup or change the textures. Video tutorial about day/night cycle: http://www....


Only top voted, non community-wiki answers of a minimum length are eligible