party of fx

106
Party of FX Trucos, efectos y pipeline de arte para juegos mobile Nicolás Biondi ([email protected]) Mariano Merchante ([email protected])

Upload: mariano-merchante

Post on 12-Apr-2016

686 views

Category:

Documents


0 download

DESCRIPTION

Slides for EVA 2015 presentation on art pipeline, effects and rendering tricks.

TRANSCRIPT

Page 1: Party of FX

Party of FXTrucos, efectos y pipeline de arte

para juegos mobile

Nicolás Biondi ([email protected])

Mariano Merchante ([email protected])

Page 2: Party of FX

INTRODUCCIÓN

• Juegos Casual/Mid-core• Mobile• Unity• Proyectos de 4 meses a 1.5 años• Equipo de ~15 personas

QUIÉNES SOMOSQUÉ HACEMOS

Page 3: Party of FX

INTRODUCCIÓN

• PIPELINE DE ARTE PERSONAJESESCENARIOS

• EFECTOS

DE QUÉ VAMOS A HABLAR

Page 4: Party of FX

INTRODUCCIÓNDE QUÉ VAMOS A HABLAR

http://www.kongregate.com/games/dedalord/party-of-heroes

Page 5: Party of FX

INTRODUCCIÓN

Una buena experiencia depende de:

• Espacio en disco• Memoria• Polycount • Animaciones• Drawcalls• Complejidad de shaders

A TENER EN CUENTA...

Page 6: Party of FX

PIPELINE DE ARTE¿QUÉ ES?

Serie de procesos, lineales y no lineales, cuyo resultado es un conjunto de assets (personaje, escenario, prop, animación, fx, etc.).

A través de ellos, se obtiene un producto de gran coherencia visual.

Como plus, permite la organización del equipo de trabajo, en las variables de tiempo y recursos.

Page 7: Party of FX

PIPELINE DE ARTEPERSONAJES

Page 8: Party of FX

PERSONAJESPIPELINE DE ARTE

Page 9: Party of FX

PIPELINE DE ARTEESCENARIOS

Page 10: Party of FX

PIPELINE DE ARTE

• Utilizamos SVN (ignores!)• Dev, Arte y UI separados• No sources (PSD,MB) en Unity

–Reducir tiempos de importación–Reducir dependencias de software

Repositorio

Page 11: Party of FX
Page 12: Party of FX

PIPELINE DE ARTE

El cuello de botella está en el movimiento de assets entre el directorio de Arte y Unity (trunk)

Se necesitan Herramientas para exportar/importar rápidamente.

Hay muchas formas de hacer esto, pero...

Repositorios

Page 13: Party of FX

PIPELINE DE ARTE

Desarrollamos una herramienta para integrar y agilizar la iteración de assets.

Está compuesto por:• Un archivo de configuración por máquina• Un archivo de configuración por proyecto

INTEGRACIÓN EN UNITY

Page 14: Party of FX

PIPELINE DE ARTEINTEGRACIÓN EN UNITY

Page 15: Party of FX

PIPELINE DE ARTEINTEGRACIÓN EN UNITY

Asocia directorios y archivos entre repositorios y permite:

• Regenerar assets desde Unity

Page 16: Party of FX

PIPELINE DE ARTEINTEGRACIÓN EN UNITY

Asocia directorios y archivos entre repositorios y permite:

• Regenerar assets desde Unity

• Definir reglas específicas por asset

Page 17: Party of FX

PIPELINE DE ARTEINTEGRACIÓN EN UNITY

Asocia directorios y archivos entre repositorios y permite:

• Regenerar assets desde Unity

• Definir reglas específicas por asset

• Generar y manejar dependencias entre assets– Cada proyecto define sus reglas

Page 18: Party of FX

PIPELINE DE ARTEINTEGRACIÓN EN UNITY

Page 19: Party of FX

PIPELINE DE ARTEINTEGRACIÓN EN UNITY

Nuestra filosofía es que el artista integre cada asset para previsualizar el resultado final.

Page 20: Party of FX

PARTY OF HEROES PERSONJESPIPELINE DE ARTE

Page 21: Party of FX

PERSONAJESCONCEPT ART

Page 22: Party of FX

PERSONAJES

• Sufijos y prefijos por tipo de archivo– Rigs, Meshes, Materiales, Texturas–Esqueleto y huesos adicionales

Ejemplo: HeroReference_E03; HeroSkeleton; Hero_Mesh; Hero_Mat

• Guia de nomenclatura– Simplifica la integración– Convención sobre configuración

NOMENCLATURA

Page 23: Party of FX

PERSONAJESANIMACIÓN

Para optimizar el trabajo de animación las3 evoluciones referían a 1 sólo queleto.Este esqueleto contemplaba los huesos extras de cada evolución

Page 24: Party of FX

ANIMACIÓNRIGGING

HIK

Page 25: Party of FX

PERSONAJES

Utilizamos Mecanim para compartir animaciones entre personajes humanoides.

MECANIM

Page 26: Party of FX

PERSONAJES

Unity interpreta mal algunos esqueletos :(

MECANIM

Page 27: Party of FX

PERSONAJES

¿Solución?

MECANIM

Page 28: Party of FX

PERSONAJES

Al conocer el Esqueleto la mejor solución es definir el Humanoid por Código.

MECANIM

Page 29: Party of FX

PERSONAJES

Utilizando los procesadores de assets de Unity, pudimos automatizar gran parte del proceso.

Importamos:• Modelos• Animaciones• Texturas• Controladores de animación

AUTOMATIZACIÓN

Page 30: Party of FX

PERSONAJES

Page 31: Party of FX

PERSONAJESRENDERING

Page 32: Party of FX

PERSONAJES

Ahora, lo divertido!

Fake BRDFSphereLit

Tinting

RENDERING

Page 33: Party of FX

PERSONAJES

Bidirectional Reflectance Distribution Function

FAKE BRDF

Describe cómo una superficie refleja la luz

Page 34: Party of FX

PERSONAJES

Se puede hacer una cruda aproximación de la función según el ángulo hacia la cámara y la luz.

FAKE BRDF

Luz

Page 35: Party of FX

PERSONAJESFAKE BRDF

Camara

Page 36: Party of FX

PERSONAJES

Combinando ambas, se pueden lograr resultados muy interesantes!

FAKE BRDF

Page 37: Party of FX
Page 38: Party of FX

PERSONAJES

Desventajas :(

• Requiere una luz.• Más costoso que otros métodos en mobile• La textura es poco intuitiva

FAKE BRDF

Page 39: Party of FX

PERSONAJES

Basado en un paper (The Lit Sphere: A Model for Capturing NPR Shading from Art, Sloan)

ZBrush lo popularizó con el nombre MatCap

SphereLit

Page 40: Party of FX

PERSONAJESSphereLit:

¿Cómo funciona?

Page 41: Party of FX

PERSONAJES

Lo usamos porque:

– Es razonablemente eficiente– Se pueden lograr buenos resultados– Es muy fácil de editar– Es muy intuitivo para los artistas– No requiere luces

SphereLit

Page 42: Party of FX

PERSONAJESIteración SphereLit

Page 43: Party of FX

PERSONAJESIteración SphereLit

Page 44: Party of FX

PERSONAJESIteración SphereLit

Page 45: Party of FX
Page 46: Party of FX

PERSONAJES

Variaciones interesantes:

• Fake bump mapping• Multisphere• “UberSphere”

SphereLit

Page 47: Party of FX

PERSONAJES

¡El bump mapping no tiene por qué ser correcto!

Si utilizamos la magnitud del color de la textura, se pueden lograr sutilezas interesantes.

No siempre queda bien!

Fake bump mapping

Page 48: Party of FX

PERSONAJESFake bump mapping

Page 49: Party of FX

PERSONAJES

Los artistas necesitaban resolver diferentes clases de superficies en un mismo personaje.

(mader, metal, piel, etc)

MAS MATERIALES = MAS DRAWCALLS

Ojo ¡tenemos 10 personajes por batalla!

Multi sphere mapping

Page 50: Party of FX

PERSONAJES

Consta de 4 esferas. En el UV2 codificamos un offset.

Multi sphere mapping

Page 51: Party of FX

PERSONAJES

PERO

• Tedioso configurar los UV2• Las texturas no deben superponerse• No se pueden mezclar!• Mip mapping lo rompe!

Multi sphere mapping

Page 52: Party of FX

PERSONAJES

Nuestra solución:

• Crear 4 esferas distintas• Guardarlas en los canales de una textura

RGBA• Utilizar los vertex colors como moduladores

de estas texturas• Agregar un color por esfera

“Uber Sphere”

Page 53: Party of FX

Cada canal del color representa un mapa distinto!

Page 54: Party of FX

+ +

Page 55: Party of FX
Page 56: Party of FX

PERSONAJES

Resultado: Con una sola multiplicación de matriz, se resuelve el color!

“Uber Sphere”

Page 57: Party of FX

TINTING

Page 58: Party of FX

TINTING

Cambiar dinámicamente varios colores de un personaje de forma eficiente, práctica y que se vea bien es difícil.

¿no era simplemente multiplicar un grayscale por un color?

El problema

Page 59: Party of FX

TINTINGEl problema

Page 60: Party of FX

TINTINGEl problema

Page 61: Party of FX

TINTINGEl problema

¿Por qué no usamos HSV?

Page 62: Party of FX

TINTINGGradient mapping

Page 63: Party of FX

TINTINGGradient mapping

Page 64: Party of FX

TINTING

• En el canal alpha de la textura, guardamos distintas máscaras.

Gradient mapping

Page 65: Party of FX

TINTING

• En el canal alpha de la textura, guardamos distintas máscaras.

• Cada valor de alpha representa un gradiente distinto.

Gradient mapping

Page 66: Party of FX

TINTINGGradient mapping

(ALPHA)

COLOR

Page 67: Party of FX

TINTING

• En el canal alpha de cada textura, guardamos distintas máscaras.

• Cada valor de alpha representa un gradiente distinto.

• Aplicamos gradient mapping por cada máscara

L4D2 hace algo parecido!

Gradient mapping

Page 68: Party of FX

TINTINGGradient mapping

Page 69: Party of FX

TINTING

Pero hay problemas si queremos usar más de 3 máscaras!

Gradient mapping

(ALPHA)

Page 70: Party of FX
Page 71: Party of FX

TINTING

Esto surge por el filtrado de los editores de imágenes, y por tener solo un canal.

L4D2 lo resuelve usando solo dos máscaras.

Gradient mapping

Page 72: Party of FX

TINTING

En el momento de importación, corremos un filtro de la mediana, resolviendo el problema.

Gradient mapping

Page 73: Party of FX

[DIVISOR]

ESCENARIOS

Page 74: Party of FX

ESCENARIOSEN PARTY OF HEROES

Page 75: Party of FX

ESCENARIOSEN PARTY OF HEROES

Page 76: Party of FX

ESCENARIOSEstructura (Gameplay)

Page 77: Party of FX

ESCENARIOSEstructura (Gameplay)

Page 78: Party of FX

ESCENARIOSEstructura (Gameplay)

Page 79: Party of FX

ESCENARIOSGLADE

Page 80: Party of FX

ESCENARIOSGLADE

Page 81: Party of FX

ESCENARIOSSwamp

Page 82: Party of FX

ESCENARIOS

Pantanto (256)

Color Escenario

Reflejo(32, RGB) F. Normal (128, RGB) Fog (64 TRUE)

15528 TRIS

Halo (64TC)

Halo (128x256)

Page 83: Party of FX

ESCENARIOSejemplos

vertex color

Page 84: Party of FX

ESCENARIOSejemplos

Unity 3d

Page 85: Party of FX

ESCENARIOS

Page 86: Party of FX

ESCENARIOSSWAMP

OJO con usar _Time!

Page 87: Party of FX

ESCENARIOSejemplos

14000 TRIS

Page 88: Party of FX

ESCENARIOSejemplos

1024

64 (16B)

256

Page 89: Party of FX

ESCENARIOSejemplos

Page 90: Party of FX

ESCENARIOSejemplos

Page 91: Party of FX
Page 92: Party of FX

EFECTOS

Page 93: Party of FX

EFECTOS

Dos desventajas principales:• El jugador podía manejar una cámara ~360• El juego debía pesar poco

Esto significa que debíamos reducir el uso de:• Billboards• Spritesheets

Meshes!

Page 94: Party of FX

EFECTOSMESH LIBRARY

Page 95: Party of FX

EFECTOSDISTANCE FIELDS

En una textura, cada pixel representa la mínima distancia a una “forma”, y luego se umbraliza.

Se suele usar para texto.

Page 96: Party of FX

EFECTOSDISTANCE FIELDS

En una textura, cada pixel representa la mínima distancia a una “forma”, y luego se umbraliza.

Se suele usar para texto.

Page 97: Party of FX

EFECTOSDISTANCE FIELDS

Muy útil para animar desintegraciones!

Page 98: Party of FX

EFECTOSDISTANCE FIELDS

Se puede suavizar usando smoothstep

Page 99: Party of FX

EFECTOSDISTANCE FIELDS

Page 100: Party of FX

EFECTOSSNOW FOREST REVISITED

Page 101: Party of FX

SHURIKENDISTANCE FIELDS

Si combinamos shuriken con shaders un poco más complejos, se pueden hacer muchos efectos distintos usando el vertex color.

Page 102: Party of FX

SHURIKENMESH EXPLOSIONS

Si combinamos shuriken con shaders un poco más complejos, se pueden hacer muchos efectos distintos usando el vertex color.

Page 103: Party of FX

SHURIKENFULLSCREEN FLASHES

Se puede usar un shader que dibuja en toda la pantalla, y manejarlo como si fuese una partícula!

Page 104: Party of FX

SHURIKEN

Este tipo de trucos nos permitió coreografiar mejor los efectos.

Veamos uno...

Page 105: Party of FX

CONCLUSION

Page 106: Party of FX

¿PREGUNTAS?