Thinking about some RPG..Android version.

Started by EgonOlsen, December 17, 2011, 11:42:01 PM

Previous topic - Next topic

Thomas.

Vainly trying to figure out why everyone are using normal mapping in tangent space instead of object space. Object space is faster and less memory-intensive. Or what is main differences?

EgonOlsen

Object space normal maps can't be reused on different objects and you can't create (...fake) them simply based on a texture. In addition, using them on deforming objects can be an issue.

EgonOlsen


Thomas.

Every red point is obstacle? I see monastery and houses :) Do you want these models? They are from my old and probably dead project...


EgonOlsen

Yes, they are obstacles. The smaller dots are mostly trees and rocks. I've you've some models to spare, i would be very grateful.

EgonOlsen


EgonOlsen

The NPCs now may have a (very subtle) blob shadow. I wanted to add this for ages, but i hadn't figured out how to do it efficiently on Android. After all, a simple flat shadow plane that moves with the character won't work in this terrain. It has to adopt to the terrain to a degree but i couldn't use a projective texture either. So i had to look for a way to make a plane roughly follow the terrain without impacting performance...and this is it:


Thomas.

Nice, did you have any problems with depth buffer accuracy?

EgonOlsen

#383
Nothing noticable. The plane is shifted a few units up, which you usually can't see. I tested it on desktop, Adreno and Tegra so far and it works fine on them. I'll try on PowerVR once the damn slow Nexus S has finished all updates that it thinks it has to install (haven't turned it on for some weeks). The Mali device is on holiday together with my wife, so i can't try that ATM... ;)

raft

looks nice  :) how do you make shadow plane fit to terrain? using collisions similar to car sample? ie: 4 collisions for 4 corners of plane?

EgonOlsen

Quote from: raft on June 12, 2013, 12:05:01 PM
... using collisions similar to car sample? ie: 4 collisions for 4 corners of plane?
No, not exactly. That was my first idea but it had the problem that it was much too slow on Android to do it that way. But i already have this height map that i'm using for npc movement anyway and i have a method that returns the current height at any point based on this height map and a strange linear interpolation. I'm using this to take three samples around the enemies position and calculate the normal vector of the plane that these three points span. I'm then using a linear interpolation between this vector and the former one and rotate the shadow plane to match the resulting vector.
So...it's a linear interpolation of a linear interpolation of some height map values...sounds strange but works pretty well.

IZACIZAC

Are you streaming in map data, or pre-loading it all? Just curious because I am trying to stream map data and have no idea how to do it efficiently, any pointers would be awesome :)

EgonOlsen

Nope, no streaming. It's loaded as one large lump of geometry. It's not that large, so that's not a problem. I'm not trying to create something in the range of Skyrim here.

Irony

Looks definitely better with the shadows. Can you already shoot those bastards?  ;D

EgonOlsen

Quote from: Irony on June 23, 2013, 02:17:23 PM
Can you already shoot those bastards?  ;D
Yes, in the latest version, you can shoot them with the bow.