Posts

Showing posts from November, 2017

Screen space outline(Post Process Material)

Image
Step 0. Mesh based outline : https://gameenginebread.blogspot.com/2017/09/how-to-draw-outline-without-stencil.html Mesh based outline looks good and easy to modify it's thickness and color. But it is too heavy to draw everything with outline mesh. So, in this post, we will make post process material based on outline for full screen outline. Step 1. The basic idea is to draw the outline using depth values. This is the final material. Step 2. These are the result screenshots.  Without outline. With outline. Remaining Issue. It is easy to apply but has various drawbacks. - It can't change thickness. - It is difficult to exclude outline on certain objects.

Indoor/Outdoor material transition.

Image
Step 0. Generally, when you are outside, you do not need to draw the inside with the best quality. The same is true for the opposite case. LOD is good for performance, but in some cases, the distance may be ambiguous and too much quality is lost. So In this article, we will test indoor/outdoor material optimization with Unreal Engine 4. Step 1. We will use 'Material Parameter Collection'. You can see a related post : https://gameenginebread.blogspot.com/2017/06/night-visiontoggle-in-real-time.html Create new 'material parameter collection'. Add a parameter named 'Indoor'. Create new trigger box type blueprint. Change 'Indoor' according to the player overlapping status. Step 2. It works differently depending on the state of 'MaterialParameterColletion'. Step 3. This is the result screen. More... It may take more effort to make material. So consider these things before use thi...

Occlusion Test Actor

Image
Step 0. Knowing how 'Occlusion' works will greatly help you optimize performance. Type console command, r.VisualizeOccludedPrimitives 1 This command shows the mesh covered by the green line. But it only works in the editor. So In this article, we will make an actor to help us find distance and bound. Step 1. Create new StaticMeshActor. Add two TextRender components and arrow component. Check 'Use Attach Parent Bound'. Step 2. Draw the distance to player character and Bound size. This is convenient to use with OcclusionCullVolume. Step 3. This is the result screen. Step 4. Type console command 'show bounds' to see more information.

Animation reuse for improved performance

Image
Step 0. A well-made game shows a lot of characters without losing the quality of the rendering. In general, fewer bone counts and proper LOD usage will help optimize character rendering performance. A closer look reveals that the animation is being reused. Undoubtedly it will be very helpful. This time, we will do a basic test for 'animation reuse' with Unreal engine 4. Step 1. 'Set Master Pose Component' is the blueprint we were looking for. I've used it before in another article. https://gameenginebread.blogspot.com/2017/09/render-skeletal-mesh-with-different.html Step 2. Create many characters for testing. I used 21 * 21 characters. Step 3. This is the result of reusing the animation. Type console command 'stat anim' to see detail. 'AnimGameThreadTime' : 2.91ms CPU i7 6700k and Geforce 1060 are installed in the test PC. Step 4. Remove link to 'Set Master Pose Component' node and test a...

Tall grass(bush) that responds to touch

Image
Step 0. Let's create a tall grass(bush) that responds to touch..    There is a way to replace the material according to the situation. In some cases, it can be heavy and complex.  It is convenient to implement so that material has animation. Step 1. We implement 'default idle animation' and 'touch reaction' here. This is the final material screen shot. If you want better animation consider this : https://docs.unrealengine.com/latest/INT/Engine/Animation/Tools/VertexAnimationTool/ Step 2. Add new actor class type that parent class is StaticMeshActor. Change mesh and it's material. Change collision type to 'OverlapOnlyPawn'. Step 3. Create event graph of TallGrassActor. At this point you need to find the direction of the Pawn. Step 4. Place multiple TallGrassActors at level. Set mobility 'Stationary' for shadow. Step 5. The result screen.