26 May 2015

Materials and Textures

 

Materials and Textures

 http://blog.machinimatrix.org/materials-and-textures/


Blender provides 2 completely different methods
to get color and texture to your objects.
The first option is: assigning images to uv-faces,
and the secnd option is to add materials and textures to objects,
This video introduces both options,
and you will get some insight into typical workflows
and common problems,
So, here is how you can assign any image of your choice
to faces of an object:
You do that by switching to edit-mode,
then first select the faces which you want to assign to an image,
and finally, in the UV-editor, select the image of your choice.
And Now the selected image is assigned to the selected faces.
You can make this image visible in the 3D view as follows:
Open the object properties sidebar,
and there, enable texured-solid mode.
You can assign every face of your object to a different image.
But you can assign only one image per face.
From now on we will name these images face-textures.
This name is directly derived from the con-text.
The reasoning is simple,
the images are assigned to a set of faces,
and they are used as textures on the model,
Put all of this together, and you get: face-textures.
But beware, Blender’s internal renderer does not use faystextures
by default. So, when you render your objects now, then you will
see no texture. But you can change this in the Material settings.
locate the Material Options panel,
and there enable face-textures.
And now the renderer also takes the faystextures into account.
It often makes sense to use different face textures
for different parts of a model.
But sometimes it can be useful to assign all faces of the object
to the same face-texture.
Note that the association between texture-areas and faces
is defined with a UV-map.
Once an image has been assigned as face-texture,
it keeps this property until the assignement is intentionally changed.
Note that if your final goal is to create models for game-engines,
then most probably its the face textures
that you want to import into your target system.
ok, so far i have explained how to add face-textures to models,
But how do we create them ?
well, You have 2 options to do that.
Remember that face-textures are simple images,
hence you can create them in any external 2D-editor.
Blender supports this workflow as follows.
first it provides the option to create a uv-template.
You can export this template to your image-editor,
and then create the face textures around the uv-template.
Then, finally, you now only need to import your painted image into blender,
and then you can assign that image to your object as face-texture,
just as i have shown before.
But Blender also offers a secnd option to create face-textures.
this is by baking textures from materials,
But before i can show you how to do that,
we first have to introduce blender’s
material-and-texture system.
Well, Textures use very different
and partially very complex methods
to generate visual look.
Textures can be defined in the context of materials,
That is, you first create your material,
Then, for each material you get a texture stack.
This stack is accessible from the texture-editor,
and here you define your textures.
Blender provides a couple of textures out of the box, and
Most of these textures are so called procedural-textures.
that is, the visual texture patterns are calculated by a mathematical algorithm.
But there is also one special texture type,
which accepts images or videos as input.
As a matter of fact these image-textures are the only-textures
which are directly displayed in the 3D-view.
And in order to make them visible,
you must switch to GLSL texture-mode.
Set the viewport-shading to texture,
and in the object properties-sidebar set display-shading to GLSL
So, image-textures are used to directly add images to the texture-stack.
Hence they provide the possibility to use images in your materials.
One possible scenario is to use image-textures
to simulate texture-cloth layers,
by placing them
on top of each other.
So far i have described
how to create materials by using textures.
but how can we get these textures out of blender
and into our game engine?
Remember that blender is a tool for creating images and animations,
so Blender uses its own render-engine to convert the textures into visible images.
But our goal is different. We are not interested in the render results,
we want to get access to the face textures,
and export these as textures for an external program.
Hence we need to convert the materials into something
that also can be used with-in another target system.
So, how do we do that? the answer is?
we can bake the materials to face-textures.
Let us see now how that is done.
So, all starts over again at the face-texture.
But this time we do not want to provide a ready made image for input to Blender.
Now we want to provide a fresh and empty image
to collect the output of the bake process.
So we open the uv-editor again,
and then we create a new image.
Remember that this image gets instantly assigned
to the currently selected faces of the active object.
thus, this new image is already our face-texture,
although it still is completely empty,
which in this case means, its completely black.
So, when you now switch back to textured solid mode,
then the active object is rendered in black.
So here is how you can bake your texture.
go to the render properties section,
there, locate the bake tool,
then select bake-mode: textures,
and finally click the bake-button.
Now the baker processes the texture stack
of the selected object, and calculates the
baked texture. In the final bake-step
the bake-tool locates the object’s face texture,
and eventually copies the result of its calculation
into that image.
And finally the baked face-texture is exposed
on your object for inspection.
And here is a little trick to get the just created face-texture
also displayed in GLSL-texture-mode.
Go back to the texture-stack of your object,
and there add a new image-texture at the bottom of the stack.
Please remember that procedural textures do never show up in the 3d view,
but images do. And we just have baked a face-texture.
So you now simply Assign the face texture as input-image,
and then, you are almost done,
You only need to tell blender to use uv-coordinates,
and finally you can see the face-texture in GLSL-texture-mode.
But here you have to take care.
We run into another problem
as soon as we try to bake the texture again.
Then Blender tells you that it has found a feedback loop.
That is, we have added the face texture to the texture stack,
but the face texture is also the result of the bake-process,
And that is a feedback loop.
So you always have to remember to disable the face-texture before you bake.
And after the bake is finished you can safely re enable the face texture to
see the new result.
Let me finally tell you about another important
feature of blender’s material system.
Lets get back to the material settings.
Here, you can create multiple material slots for an object,
you can add a different material to each slot,
and you can assign each material slot to different faces.
And finally each material slot has its own texture stack,
Hence it is possible to texturize different parts of an object with different materials.
And if you ever want to consolidate
all your different materials into one single face texture,
then you can even do that,
simply by assigning all faces of your object to one face-texture,
take care to avoid feedback loops,
then bake your object,
and at the end? your consolidated texture shows up almost automatically.
Well, Isn’t this easy going stuff ?
Actually not,
but maybe you only need to get some practice,
so, before you start-over again,
here is a short summary.
First: face-textures are simple images.
They are directly associated to a set of mesh faces.
The association is controlled by uv-maps.
Secnd: face-textures
are either created by a blender bake process,
or they can be provided as ready made images.
For example they can be created in photo-shop
or any other image-editor.
Third: Blender’s materials provide texture stacks
and a set of procedural-textures to create more
complex visual appearance.
One special form of textures is the Image-texture.
Image-textures allow to add images into the material-texture stack.
You can assign multiple materials to an object,
where each material uses its own texture-stack,
and it can be assigned to a subset of the model’s faces.
Blender Materials can be baked into simple image-textures.
and finally, These baked textures can be exported to external game-engines.
I hope this video helps a bit to sort out
how the various parts of blender’s texturing workflow work together.
There is certainly a lot more to say.
but i will stop here, and recommend that you now take over and
start experimenting with your own textures.

03 April 2015

轮胎老化/硬化了/出小裂缝。。就要更换。。安全至上。。避免爆胎









车子的轮胎跑了3年。跑了超过60千公里里数。已经开始老化了。出现小裂缝


花纹还有,唯独树胶已经老化/硬化。出现小裂缝。

大家要注意。类似这种轮胎老化/出现小裂缝。在高速行驶的时候。高压和高温会造成爆胎。高速行驶的车子会失控。

------------
如上图,最近刚帮车子换了4条轮胎。原因是老化问题。不适合我长途驾驶。会有安全风险。
如果车子的轮胎出现类似图中的情况。大家千万别为了省钱,而不做更换。
大家请记住,轮胎是树胶做的。肯定会老化。就算很少开车,过了3-5,你也要定时注意轮胎的状况。类似我的情况,我车胎的花纹还可以继续跑20千公里,但是基于老化问题,我不得不换。


03 October 2014

重新出发

兜兜转转。。曲曲折折。。回归原点。。
加油吧。。路还很长。。

02 January 2014

丹阳的真实批发价

第一、眼镜镜片的价格,是根据折射光率来的。
1.56折射光率,也叫普通片、大白片,出厂价10元左右。300度以下
1.60折射光率,也叫超薄片,出厂价20元人民币左右。300-600度
1.67折射光率,也叫超超薄片,出厂价70元左右。600-1000度
1.74折射光率,叫超超超薄片,出厂价200元人民币左右。适合眼睛度数1000度以上的人群。

眼镜批发价,只管折射光率,不管度数,同折射光率的,同一个批发价。
超超薄片,是因为它比超薄还要薄。

超超超薄片结实吗? 一样,只是折射光率提高了,也就是同样度数,镜片变薄了。

其他因素不重要,因为也就多个5分钱,1毛钱的事情。
比如加个防辐射膜,也就多5分钱成本。


眼镜框主要分类为:铜架、钢丝架、记忆合金架、半钛架、全钛架、Z-钛架、铝镁合金架等等。