2016년 1월 25일 월요일

UE4 Rendering thread problem related to Editor

UE4 has multi-thread rendering architecture which is similar to UE3(almost same..).
Game thread datas(PrimitiveComponent..) and Rendering thread datas(SceneProxy..) are main components of it.

Game thread enqueue asynchronous rendering command continously to rendering thread. Applying changed property in game thread to rendering thread is one of them.

Usually there is no bad thing here. Until Editor and UpdateRendertargetCapture are used together.

case :
1. Component property is changed by editor click.(from Window Msg Pump)
2. There is 2dSceneCaptureActor in the scene.
3. GarbageCollection is performed.

problem :
1. some object could be garbage collected.
2. Scene could be rendered before change of property is applied to render thread.
3. Garbaged collected object could be referenced in rendering thread.

I resolved this sitation by FlushRenderingCommand. But still, We could say this is flaw of UE4 multi-threading or update capture architecture.

2016년 1월 8일 금요일

Improving outline postprocess using stencil operation.

There is excellent tutorial for Outline postprocess.

http://www.tomlooman.com/ue4-outline-post-process/

His technique support pretty outline using custom depth(simliar technique is already being used by editor selected object), and also provide nice multi color feature too.

But what if your game designer want to specify occluders who cause occludee outlined?

Here is my solution.

1. occludee writes team color ID to stencil.
2. occluder increment stencil by 1(to do this, we need to slightly modify custom depth path, PrimitiveComponent has occluder/occludee flag and it is rendered seperately in custom depth path)
3. In PostProcess, only increment stencil pixel is considered as "outlined"

This is very useful when there are too much outline in screen, and we want to use only needed.


Got full time graphics programmer job.

Recently, I came back to game industry. and am now full time graphics programmer.
People might say that why would we need graphics programmer if we use engine like UE4. but even UE4 doesn't have all the features we want. so there are tons of things to be touched by graphics programmer.

Fortunately, UE4 is a lot easier than UE4 to modify or extend.

Here is what I am doing now.

1. understand inside of renderer, and guide artist team to use engine correctly(ex: PBR input)
2. adding missing features(ex : lighting channel in UE3 or Hair rendering and etc..)
3. make tools for faster artistic iteration and faster tweak.

I am thinking if there are more things to be done. and these are very interesing so far.

I will post some tips later.