Thursday, 1 December 2011

Scene Texturing



This is a scene that I have put together roughly to show my texturing skills.

WineGlass Texturing


Finally with the shaders set and behaving normally, I exported the UVs from Maya and brought it into photoshop to start texturing process. I deliberately created the UV in a way that all the main surfaces on the upper part of the glass are connected on the UV layout. So I can just paint the dirty and stains freely without having to worry about the ugly seams showing up in the render.


I used a 'Smear' tool in photoshop, which distorts the texture to match the UV layout. This way the stain will be placed nicely around the tip edge of the glass.



Just to see what it looks like, I plugged the texture map into the 'Color' slot under 'Diffuse' section of the mia_material shader, but the stain was very faint.


This is a finished version of the texture map. As a result of the previous render tests, I made the texture really dirty, hoping this will compensate for the loss of details.
Besides the tip ring stain at the start, I have included a layer of finger prints, two layers of wine dripping trail, also two layers of wine spray stain. On top of that is a layer of dust with marks of finger prints and water drip marks over it.



I did a render of the lower part as well, though you can faintly see a bit of dirt pattern on the stem and the base, but it is still way too clean compare to what I am trying to achieve.


So I tried to create a specular map for it, trying to see if that would change the way light reacts with the dirt and hence making it more effective.



I plugged the specular map into 'Color' slot of 'Reflection' but nothing seemed to have change drastically. I tried to change the 'Glossiness' and many other settings.


With no luck, I decided to redo the entire step again and see if I have missed anything. Above is an image rendered out without the photonic material plugged in.


This is with photonic material plugged in, as well as the specular map influencing the caustic patterns.


Then, I decided to try and plug the texture map into 'Color' slot in the 'Refraction' section, and something dramatic has happened.




Above images are getting closer to what I was looking for, so it is apparent that I should have plugged it into the 'Refraction' area in the first place. Now the texture is way over the top.





I played around with different specular and diffuse settings until I think it looks right.




Then I fixed the look of the caustic patterns.



The tutorial also taught me how to use the 'Map Visualisers' to show what the caustic patterns are like.



 At the end I fixed the texture maps and reduced the amount of dirt on it.





WineGlass and Caustics


This is the model of the wine glass modelled by Jure Bralic and UVed by me in Silo. I have exported the model out of Silo and brought it into Maya. For transparent objects like glass and liquid, which I have never textured before, I decided to bring the model into Maya first and establish the shaders first. This way I could at least see how realistic it would look without any dirt on it.


However, the renders always show up like the above images, where certain part of the model seems to be working correctly while other parts do not. The caustic patterns seemed fine, and I have played around with the shader's settings a lot, still couldn't seem to fix it.


I then quickly applied a random gold texture, to see how a texture map would react with the glass at this state. Although the texture did show up in the render, but the reflection and refraction on the glass surface itself still seems to be inaccurate.


Thus I started some in-depth research concerning rendering caustic objects. I used one of Digital Tutor's Mental Ray tutorials regarding caustics. In order to eliminate the possibility of my settings being wrong, I decided to use the model provided by the Digital Tutors.


By increasing the amount of caustic photons casted by the light, I was able to determine how sharp or blurry I'd like my caustic patterns to be.



The tutorials taught me how to stop Maya from rebuilding the 'Photon Map' while rendering. This keeps the photons that were calculated during the previous render, so Maya could save time on recalculating the photons. However, since the photons were not recalculated in each frame, this method will not work with any moving objects in the scene. Because the photons will stay at the same place even after the object has moved. But for testing the look of objects, it does safe quite a bit of time.


By ticking 'Refractive Caustic' under 'Advanced Refraction' section of a Mia_Material, I was able to let the vase create realistic caustic patterns based on the colour of the vase.


By playing around with the settings, I was able to achieve some very interesting results with Mental Ray's 'dielectric material'.


By plugging a 'dielectric photonic material' into the 'Photon Shader' slot, it allows me to control the colour of the caustic patterns completely independently from the actual colour and shape of the model. This could be extremely useful in a lot of cases.


The tutorial taught me how to create glassy objects using both 'mia_material' and 'dielectric_material', both could create realistic caustic patterns. The also showed me how to create realistic liquid from the container itself without any particle simulations. Everything is simply done by detaching bottom half of the inner layer model and cover the top with a Nurbs surface. Like the images shown below:




The amount of 'Photon Tracing' in the render globals are also very critical in determining how many surfaces are allowed for the light to pass through, reflect or refract. Notice the refraction that is added underneath the pitcher in the second and third images shown above.


I applied a Ramp node into the photonic material shader and created this effect


Notice the artifact at the bottom of the highball glass. This is created by an unrealistic shadow calculation.


Thus I increased the number of shadows allowed in the scene, but I also need to increase the 'Ray Depth Limit' of my area light.


The tutorials then taught me how to use a 'mib_shadow_transparency' to adjust the shadows independently from the scene. This requires plugging the node into 'Shadow Shader' slot.


Now I can create a realistic colour spill on the shadows without having the need of expensive rendering and heavy ray trace calculations.


Although I followed the tutorials until this step, I realised there was some strange artifacts showing up on my renders.


Tested that this could be fixed by increasing the 'Anti Aliasing Quality' in the render globals, which drastically increase the render time however. And even with a 'Max Sample Level' of 4, a bit of the rendering artifacts are still visible on a close up of the objects.


After I finished the tutorial, I decided to bring in the wine glass into the same scene for comparison sake. However the render still turned out strangely even with the exact same shader applied.


The tutorial however did mention that when it comes to the mental ray nodes, the model itself may be a concern as well. The normals need to be facing outward for an accurate calculation of raytracing. Also all the models provided by Digital Tutors were either modled with Nurbs or Subdivision surfaces. As a result, I converted the wine glass from a polygon to nurbs. Then it starts to look normal.


With the technique I learnt from the tutorial, I created some wine in the wine glass, too.


I applied the same texture map again, now the shaders are set correctly, in order to see what it would look like. The texture gave the glass a nice layer of yellow tint, but this is not a dirty look that I am trying to achieve.



Though the reflection and refraction seem to be correct, but the colour of the wine still seems very strange no matter how I change it.


Then I decided to check if the 'Normals' of the wine itself is facing the right way. Above image is what it looks like when the normals of the wine was reversed.
However, when I changed the model from polygon to nurbs, it has removed the UV layout, which I was not aware of.


As a test, I tried to change the nurbs model back to polygon again, but it completely messed up the typology and created strange results like this when rendered.



For comparison, I kept the converted polygon model on the left, and the nurbs model in the middle and reimported the wine glass again as polygon with UVs.


I converted the new polygon wine glass into a subdivision surface model, which gave a much better result, and also kept the UVs. However, the bottom bit of the subdivision glass now looks a bit strange.


So I double checked to make sure it's not the 'Normals' that's effecting it.


Normals of the wine facing inward.


Normals of the wine facing outwards.


I moved the wine into the subdivision glass to see if it would look the same. The result was good.