Frictional Games Forum (read-only)
[ART] Blender Reflection Texture - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [ART] Blender Reflection Texture (/thread-20189.html)

Pages: 1 2


Blender Reflection Texture - Rapture - 02-05-2013

Played around with Blender again and tried to make a crystal texture? It looks pretty bad with all the reflection on but I wanted to know if I could bring that into the game.

Spoiler below!

Can I bring this texture into the game? It renders ok (Their some some strange white line artifacts though).

Here is the ".mat" file for it. (The two textures are a plain blue and a ocean water on top of it.)
Spoiler below!
<Material>
<Main DepthTest="True" PhysicsMaterial="Default" Type="SolidDiffuse" />
<TextureUnits>
<Diffuse AnimFrameTime="" AnimMode="" File="cgtextures_WaterFoam0006_1_M.jpg" Mipmaps="true" Type="2D" Wrap="Repeat" />
<Diffuse AnimFrameTime="" AnimMode="" File="Crystal 1 Damaged Base.png" Mipmaps="true" Type="2D" Wrap="Repeat" />
</TextureUnits>
<SpecificVariables>
<Var Name="HeightMapScale" Value="0.05000000074505806" />
<Var Name="HeightMapBias" Value="0" />
<Var Name="FrenselBias" Value="0.20000000298023224" />
<Var Name="FrenselPow" Value="8" />
<Var Name="AlphaDissolveFilter" Value="false" />
</SpecificVariables>
</Material>
I'm not sure what I need to add or do to get it working, if that's possible.

//------------
Another thing that has been bugging me forever. Is how do you freaking draw (or imagine) 2d art onto a 3d object?

Trying to UV unwrap this crystal was a mess, it's nothing like the millions of character model unwraps out their. Nor any of the few tree unwraps (Which I tried to use as a base line to unwrap it)
So the UVs are just random polygons scattered around.

I tried in GIMP to color in some darker blue and lighter blue, but the edges would show obviously that nothing matches when it maps the 3d object.

Urgh so frustrating.


RE: Blender Reflection Texture - Statyk - 02-05-2013

Are you trying to take a blender material and use it in hpl? I'm not sure if that works.


RE: Blender Reflection Texture - Rapture - 02-05-2013

I guess so, I might be using the wrong approach...

In your Horizon project, you had some concept art for some snowy/ice levels. If you were going to make a Ice Crystal/See through material with a shiny/reflective/glossy material. How would you go about getting it into HPL?

Looking at the Modelview, their are 9 "Material Textures"
Diffuse - Basic texture I think
Specular - Shinyness?
Height - ???
Cubemap - A special thing for skyboxes?
DissolveAlpha - Something about Alpha, not sure what the "Dissolve" piece means.
NMap - Bump mapping or something, gives more detail.
Alpha - I think a material I would be using, but I'm not sure how in this case because I want the object/material to have some reflection/glossy/shiny look to it.
Illumination - Bloom?
Refraction - Something to deal with the lighting?


RE: Blender Reflection Texture - GraphicsKid - 02-05-2013

Diffuse is what color the texture is.
Specular is a map that defines how visible highlights are.
Height is used only for parallax occlusion mapped surfaces (like the walls). This is where it's really flat geometry, but the shader uses this height map to distort the texture coordinates to give you the impression that stuff is poking out or poking into a flat surface.
Cubemap is (if I'm not mistaken) a cube shaped map that wraps around the object to make fast, fake reflections (so I think THIS is what you're after)
Dissolve alpha - not sure.
NMap - a map that tells what direction the light should appear to strike the surface at. A way of faking detail in a flat polygon. NOT the same as a bump map. Bump maps are black and white and only give height, wheras normal maps give normal, or direction to the surface, and tend to be a light blueish color overall, with red and green bits showing direction.
Alpha - this is to make the surface partly transparent, like smoke, or say for example a leaf might be a flat polygon but with a round, white shape on black as an alpha channel.
Illumination - illuminates the object, ie it doesn't have to have a light on it to be visible. So this could be things like the inner glowing bits on a burning piece of wood.
Refraction - not sure what it means here in the hpl materia, but refraction IRL is when a transparent surface bends light, like water or glass.


RE: Blender Reflection Texture - Your Computer - 02-05-2013

You're going to want a cubemap for the crystal's HPL material. Soliddiffuse material should work; unless you want it to be somewhat transparent, then translucent would be the one to pick.

As for UV unwrap, i don't think it matters how you unwrap it, since it's a crystal. Just have Blender do a "smart unwrap", then bake the texture.


RE: Blender Reflection Texture - Rapture - 02-05-2013

(02-05-2013, 08:51 AM)Your Computer Wrote: You're going to want a cubemap for the crystal's HPL material. Soliddiffuse material should work; unless you want it to be somewhat transparent, then translucent would be the one to pick.

As for UV unwrap, i don't think it matters how you unwrap it, since it's a crystal. Just have Blender do a "smart unwrap", then bake the texture.
I think I might of given some mis-information with my earlier screenshot. That was the render, the actual viewport model looks like this...
Spoiler below!
[Image: blenderreflection2.jpg]
I'm not sure how to make the viewport show the exact same thing to what is being rendered (I tried GLSL Shading but that didn't work out to well). But since it takes about 3 minutes to Render the darn thing, I don't think I want it doing it in real time.

So because of that, I'm a little confused on how to bake the "texture".

First problem is that it tries to bake the ocean texture I have (If you look at my first post, picture. You can see two materials) onto the UV.

If I try to disable/remove the ocean material, it just bakes white. I don't know why its ignoring the plain blue UV material. (Which is the one where I played around with the "Influences" down below.)

Edit: And I think I will go for a cubemap. I want the crystal to atleast be somewhat see-through, and if able to distort images behind it a little if that possible in HPL.


RE: Blender Reflection Texture - xxxxxxxxxxxxxxxx - 02-05-2013

Render materials and realtime materials ("game-materials") are different. Some features of render materials can be baked into textures for realtime use - for example you can bake the Ambient Occlusion lighting and multiply it over your diffuse texture in Photoshop. (But a bake will always just give you a texture with color on it, no complex effects.)

You can't simply export a complex shader from a 3D program into a game engine - the engine wouldn't know what to do with it since it's handling the entire rendering process differently. (Because it's realtime and therefore has to be a lot faster, which excludes costly calculations like precise refraction, global illumination, real reflection, etc...)

Your crystal material there looks like quite a complex shader with refraction or the like that would not work in realtime (That's why you can't see the end result in the viewport). So what you need to do is try and replicate the effect with the simpler options the hpl material editor gives you. For example you can fake the reflectivity of the material by using a cubemap like Your Computer suggested. Fresnel should also be possible if I remember correctly.You could also put an interesting alpha on it to make it more transparent at the tip and less at the base or something like that...
Distortion is not possible, I think... Might want to use UDK for fun stuff like that Wink


RE: Blender Reflection Texture - Your Computer - 02-05-2013

Here's a screenshot of crystals i made with a water HPL2 material:

[Image: rRhkLVz.jpg]

The diffuse texture is a solid blue color--nothing fancy. The cubemap i used is a cubemap shipped with the game: textures/envmaps/water_castlebase_cubemap.dds

I removed the wave properties from the water material so there isn't any odd texture animation.


RE: Blender Reflection Texture - Rapture - 02-06-2013

Hmm I'm trying the same thing I think, I have a solid blue UV picture for the diffuse. And I'm using the same cubemap your using (I opened it up, is it suppose to be a blurred version of the castlebase wall?), I made a copy and put it into the same folder because I felt to lazy to put it in the full path.
Spoiler below!
<Material>
<Main DepthTest="True" PhysicsMaterial="Default" Type="SolidDiffuse" />
<TextureUnits>
<Diffuse AnimFrameTime="0" AnimMode="None" Compress="true" File="Crystal 1 Damaged Base.png" MipMaps="true" Type="2D" Wrap="Repeat" />
<CubeMap AnimFrameTime="0" AnimMode="None" Compress="true" File="water_castlebase_cubemap.dds" MipMaps="true" Type="Cube" Wrap="Repeat" />
</TextureUnits>
<SpecificVariables>
<Var Name="HeightMapScale" Value="0.05000000074505806" />
<Var Name="HeightMapBias" Value="0" />
<Var Name="FrenselBias" Value="0.20000000298023224" />
<Var Name="FrenselPow" Value="8" />
<Var Name="AlphaDissolveFilter" Value="false" />
</SpecificVariables>
</Material>

All it seems to do is increase the lighting on the object by a extremely small amount. I toyed with 2 other entities that have cubemaps (Entity>Bottle>Chemical Bottle & Entity>Special>Sewer Duct Water) and their Cubemaps seem to do the same thing.

What am I doing wrong? Sad

Is their anything you did in Blender/Maya with the crystal before exporting it?


RE: Blender Reflection Texture - Your Computer - 02-06-2013

(02-06-2013, 01:47 AM)Rapture Wrote: What am I doing wrong? Sad

According to the XML you posted, you didn't change the type to "water;" you still have the type as "soliddiffuse."