вторник, 3 июля 2018 г.

Fake interior shader for cheap windows

How to create material to simulate interior through window in Unreal engine.

In many outdoor environments like cityscapes there are a lot of different buildings. You’d probably want to show that buildings are not empty box-like objects. Instead, they have various rooms interiors visible through their windows. This could be expensive as long as you need to model all exteriors, texture them and set-up lights. It became even more expensive if you need use some glass shader to make windows looks more material. The glass could probably reflect some light or be dirty. And at the same time it should be transparent. Transparent objects are expensive.

But in case when such interiors are part of background, what means that its is not mentioned that player can be near enough to explore them, there is some hacks.

Parallax Texture

The first is to use parallax texture.
This approach was used such games as Bioshock Infinite and many other:

Cubemap Texture

The more accurate approach is to use a cubemap. This method gives you more realistic result.

суббота, 4 февраля 2017 г.

Node-based Visual dialogue Editor for Unity

I'm working on visual node-based dialogue editor for Unity. Currently, I have alpha that allows not only to draw dialogue nodes, but call functions, check conditions and wait for events. I've already tested it into my small text quest and found it very usefull and handy. On a screenshot below you can see, how some dialogue may looks inside my editor:

The interface is pretty simple, almost everything is driven through context menues and hotkeys.
What is so interesting you can see here?

Function calls.
You can implement any function in C# and call it in your script. (See third node) It supports various arguments. Currently, only string, float. int, bool and Unity.Object types of args are supported. On a sample you can see, that function "ShowWindow" is called with argument "NameForm". In order to be invoked, function must be exposed on C# side by calling a method. After this, function will be available from any dialog asset.

Event Bindings.
As you can see, after "ShowWindow" node, there is another node. This node suspends dialog evaluation until event OnScreenClosed will be fired. This event declared on c# side as event without any parameters. When event will be triggered, dialog will continue it's flow.

It supports branching. You can see that dialog has three options to continue. Node "Switch Dialog Flow" let you to create branches of options. Selection type:"User Selected" means, that every option after Switch node will be displayed on a screen, and after player makes a choice, dialog continues.
You can create and check conditions inside dialogues. Every dialogue node has a field where you can write some expression to check. Expression is formed from conditions. Condition has its name and state: true, false, notexisted. On example below, there is only one condition: door_closed. It is created for a first time with its state set to false. If player ask NPC to close a door, then condition will change it's state to true and dialog flow will be returned at switch where node "Close the door" won't be shown for that time.

I'm going to implemet some extra features, after that editor will be available at Unity Store:
  • Exposing variables
  • Support for math and boolean expressions
  • In-script varialbes and functions definitions
  • Binary serialization of data, stored inside of nodes
  • Support for localization

суббота, 26 ноября 2016 г.

Finished Inventory Grid

I'm working on GUI system for Insomnia RPG. I've done alot of work but there is still much here.
Today I'm finished inventory grid widget that allows player to manage his inventory.

Players will be able to disassemble things to get resources that can be spent when crafting new stuff. We althogh have a barther system that allow to trade things with NPCs.

This widget is used on loot and trading screen as well as on character inventory screen.

среда, 24 августа 2016 г.

Lens Flares Has Been Released on Epic Marketplace

I designed a shader to help simulate various lens flares effects like flares around light sources, glow, light spikes. This works correctly for all cases including casese with overlapping.

My lens flares material pack has been released on Marketplace and available from this link: https://www.unrealengine.com/marketplace/custom-lens-flares-material

You can read more here:

среда, 17 августа 2016 г.

Radial Blur Shader in Unreal Engine 4

Today I've made this simple post process material, that applies a radial blur to screen. That was made for a sniper rifle mode in game, when player is looking through a optical sight. And we've got this raw effect:

среда, 10 августа 2016 г.

Serialization with Polymorphism and Inheritance in Unity

In this article, I would like to share my experience in serialization of classes with inheritance and polymorphism in Unity. If you have some troubles with serialization of ScriptableObjects or with saving your data, it’s written to help you. Here I try to explain, how to serialize your data into asset. You can download sources for this tutorial here.