Friday, 11 March 2016

Lighmaps UV

This expression keeps popping up from time to time, had to investigate.

So lighmapping is a way of baking light effect in objects. It only works for static objects and static lights. As is is baked it is not calculated in realtime. In reality a new texture incorporating the effect of lighning replaces the material's native texture and the light can be eliminated (or at least we don't need to calculate it's effect on that object in real time). Great video here.

Wikipedia page

Light in general in Unity

Lighmaps in Unity (starting point)

Now another question that I didnt understand is this UV mapping, though I think I have an idea that this is similar to the way FLAC2D from Itasca works, with local coordinates.

So this answer is great.

UV are the local coordinates of a flat surface with U and V going from 0 to 1. This video explains well what and how a UV map is built, but it really is the "skin" of the object taken out, cut in strategic places and stretched out and mapped in the coordinates.

Thursday, 10 March 2016

Normal maping

I came accross this very cool concept on a Unity video @ Lynda's course. The idea is to record surface detail of an object by taking the surface normals on an image using RGB to represent the normal vector components in each pixel.
Then we can degrade the mesh but use the normal map of the detailed version on the degraded mesh. Of course the lights must nknow how to deal with this geometrically flat surface containing detailed information on the relief. Very cool!

Because most of the surfaces will have normal normals (pointing out of the surface, a big part of the normal maps will be kind of blue, i.e. flat.



Normal mapping is a kind of Bump mapping. We can also record elevation coordinates. With these we can really deform the surface or we can use the surface topograpfy just for interaction with light.

Wikipedia for normal mapping
Wikipedia for bump mapping
Unity for normal mapping, very complete!

Tuesday, 8 March 2016

Learning Unity on Lynda.com - Part 1

Decided to take a structured Unity course to gain some structured learning. The disadvantage is that I'll have to go through stuff that doesn't mater much to me, since I'm not really developing games. More on that latter. Tha advantage is that I won't loose time looking at stuff done for older versions, repeated content and, more important, I have a structure to follow, there is always one more video to watch.

As to not developing a game, I guess that what I want to do will contain most of the components of a game.

So what I did is take a 10 day free trial on Lynda.com from Linkedin (which now wons Lynda, which makes sense) and started this course. Then I found out that the trial is for the Basic Lynda membership, which does not allow me to download the course files. Up to recently I never paid for content online, today I find that sometimes it is really worth it (maybe I now appreciate that my time is finite and valuable). I guess I'll be signing up for a Premium membership for about 25€/month, at least while learning Unity, 3DS Max and Revit.


Monday, 7 March 2016

BIM and Virtual Reality - Visualization in demanding conditions

BIM visualiation is demanding due tothe large number of objects on screen. According to this paper "Real-time visualization of building information models (BIM) - Current state vs. state-of-the-art" by Mikael Johansson and Mattias Roupé we have three strategies to accelerate:
  1. GPUcentric optimizations - maximize the raw processing power of modern GPUs. E.g. arrange the draw-order of objects by material properties to minimize state changes. It is not indefenitable scalable. 
  2. Level-of-detail - reduce the complexity of a 3D object representation when the object is far away from the current viewpoint, but who produces the simplified models?
  3. Visibility culling - only sending objects that are potentially visible to the GPU. Two kinds of culling:
    1. frustum culling, where objects are discarded if they are found to be outside the visible region of space, as defined by the virtual camera
    2. occlusion culling the: discard objects that are guaranteed to be hidden in the final image. Harder to implement but very efficient in buildings
This paper compared performance for the three viewers and they are all bad:
  • Tekla BimSight
  • Autodesk Navisworks
  • Solibri Model Viewer (the best by far).

Thursday, 10 December 2015

Meia Maratona dos Descobrimentos 2015

Fui a achar que ia correr razoavelmente bem. Fiz a Maratona de Lisboa há mais ou menos um mês e tinha algum treino de base feito. Depois de umas semanas fracas comecei a correr com os Esquilos em Monsanto e apesar de fazer poucos km (em comparação com os treinos de preparação para a maratona em que faço uns 40 ou 50 por semana, nas semanas boas) estava a sentir-me bem. Ia a apontar para 1h45 a 1h40, que é o meu melhor tempo.



Encontrei o Zé Sampaio por enorme coincidência, na largada e ele ia fazer 1h45. Pensei, vou com ele e se estiver porreiro arranco. Mas na primeira subida uma enorme confusão de gente, a desviar-me de todos, ele ia de headphones e não percebi se preferia ir na dele. Avancei e andei depressa na subida. Depois deixei-me ir com o ritmo dos que estavam à volta, que não era mau.



Os primeiros km são os que custam mais. As pernas pesam, sinto o coração a bater com força, penso no pequeno almoço forte ou fraco de mais, parece que estou em dia não. Lembro-me de virar à esquerda em Algés e bater os pés de mais no empedrado. De olhar à volta e achar que o pessoal tinha ar de quem andava devagar, mas o relógio dava um ritmo aceitável. Acho que tenho a mania que ando muito rápido, quem anda abaixo dos 5' devia ter ar de profissional, mas há muita gente com ar pouco atlético a andar a 5' e bem abaixo! Segui, a controlar o ritmo para não me custar muito o final. Escondi o tempo do relógio e ignorei o bater dos km, fui atento só à zona de bpm, sempre abaixo do 4,5.



Passei o Cais do Sodré bem, o Terreiro do Paço, já com muito espaço para correr. Antes da volta de regresso comecei a sentir-me bem forte e deixei o corpo ir como lhe apetecia. E fui, fui, fui. Comi bastante gel, bebi alguma água, só aos 15 ou 16 km é que me começou a custar. Aí foi apertar para não baixar. Vi o tempo pela primeira vez à hora e vinte e oito e devia ir aos 19km. Percebi que podia fazer em 1h37, abaixo do record e aí é que começou a doer um pouco.



Arrranjei companhia para o final, puxei por um tipo que ia a ofegar pouco atrás e ele aguentou. Senti-me forte e arranquei, sempre a puxar por ele, mas deve ter durado uns 500 m! Depois foi ele, depois eu e por aí fora até que ao fim ele caiu um pouco. Voltámos a encontrar-nos e a cumprimentar-nos junto ao chá.



Mesmo no fim escolhi um tipo para o tentar apanhar, mas não deu. Acabei em 1h36 muito, muito contente!



Sequelas: dores nos tornozelos que ainda duram passado quatro dias. E uma moleza grande grande, hoje no treino dos Esquilos fui muito atrás e fiz as subidas a passo sempre que deu.





Tuesday, 8 September 2015

Treino longo para a Maratona de Lisboa 2015

Ontem fiz um treino longo, ou melhor, O treino longo para esta preparação para a maratona de 2015. Nos últimos dias tenho tido pensamento mistos em relação a esta prova. Tenho gostado dos treinos de séries. Parecem-me bastante difíceis antes de os fazer mas depois levo-os ao fim e consigo fazer dentro dos ritmos a que me propôs, sem perder muito nas últimas séries. Esta parte sabe bem, assim como a sensação de que o plano de treinos realmente funciona a baixar a pulsação de base para os esforços.

Mas apetece-me nadar mais, fazer ginásio para fortalecer as costas e o tronco, e tenho saudades de remar. Enfim, quando escolho uma coisa perco as outras todas.

Ontem no treino longo, já atrasado, fiquei de rastos. Acabei aos 35km, exactamente onde tinha começado, mas a umas centenas de metros do carro. Arrastei-me até uma esplanada onde comi uma tosta e uma cerveja e consegui falar com a Mariana e queixar-me um bocado. Os últimos km foram mesmo a arrastar-me. Mantive o ritmo abaixo dos 6' mas com dores nas pernas, na anca esquerda, no pé direito. A parte cardio e respiratória foi tranquila, foram mesmo as pernas que lixaram. Os últimos km do percurso são miseráveis, na zona industrial do beato, sem referências a que me agarrar para ajudar a passar os km.

Enquanto corria pensava que é impossível fazer 5'/km, ou seja, três horas e meia. Se ir a cinco e meio já me custou, nem imagino como seria ir a cinco durante 42km. Parece-me chato seguir um plano de treinos que me parece bonzinho e não conseguir baixar dez minutos ao tempo, mas na verdade não comparei ainda o volume de treino nem a forma com que estava antes de começar a preparação específica. Se calhar em 2012 estava a remar mais. Também tinha menos três anos. Enfim, seja o que Deus quiser.

Também é verdade que fiz dois treinos de séries nos últimos dias, o último dois dias antes, com 15 séries de 400m, que me cansou bem. E o que me custou nesta corrida foram mesmo as pernas. 

Sei que pensei mesmo que nunca mais me meto numa maratona, mas vamos a ver o que me apetece.

Thursday, 6 August 2015

Ritmos de corrida

Calculei os meus bpm, as zonas e ao ritmo de cada uma dessas zonas. Aqui está o resumo e abaixo o a´clculo completo.










































Começa em 
BPM  Pace Velocidade
Zona 2 153 5'44'' 10.47
Zona 3 162 5'4'' 11.86
Zona 4 169 4'43'' 12.74
Zona 5 180 4'24'' 13.64

.