Page 1 of 1

How to add texture image to mesh?

Posted: Sat May 22, 2010 1:42 pm
by GeoPappas
I am having trouble getting a texture image to display on a mesh in Octane.

As a test, I created a simple rectangular plane mesh in Blender. I then created an image in Photoshop and added the image as a texture to the mesh (see 1st image below).

I then exported the image and imported the mesh in Octane, but the image doesn't show up properly (see 2nd image below). I have played with the scale of the image and other properties, but can't seem to get the image to show up on the mesh properly.

Re: How to add texture image to mesh?

Posted: Sat May 22, 2010 2:22 pm
by mib2berlin
Do you unwrap the plane in blender ? You need uv cords for obj export.

Cheers mib

Re: How to add texture image to mesh?

Posted: Sat May 22, 2010 2:34 pm
by GeoPappas
No, I am not UV unwrapping, since this is such a simple texture. There really should be no need to do UV, since this is just a flat plane with a flat image applied.

Does Octane need UV unwrapping for something as simple as this?

Re: How to add texture image to mesh?

Posted: Sat May 22, 2010 4:06 pm
by [gk]
Octane does not need unwrapping, it does however need to know where and what texture is ported over.
IF i make a plane in 3dsmax slap a bitmap on and hit render, the plane pops up in octane with the image on. No unwrapping was done.

This might be an issue in blender, or the exporter you are using from within blender.

-mads

Re: How to add texture image to mesh?

Posted: Sat May 22, 2010 4:35 pm
by radiance
blender does'nt apply an UV map to a plane, you need to unwrap it to apply an UV map first...

Radiance

Re: How to add texture image to mesh?

Posted: Sat May 22, 2010 10:02 pm
by GeoPappas
gk:

Thanks for the response.
[gk] wrote:Octane does not need unwrapping, it does however need to know where and what texture is ported over.
IF i make a plane in 3dsmax slap a bitmap on and hit render, the plane pops up in octane with the image on. No unwrapping was done.
That is exactly what I did in Blender - create a plane, add an image on it, and hit render. From within Blender it works fine. But when exported to Octane, the image doesn't show up on the plane (as stated in the original post).
[gk] wrote: This might be an issue in blender, or the exporter you are using from within blender.
Yes, it seems to be something with the way Blender is exporting and with what Octane is expecting within the import.

FYI: I am using the standard OBJ exporter from within Blender 2.49b.

This is unfortunate (for those that use Blender), since it seems to mean that meshes that have a simple texture (such as a wooden floor, leather couch, concrete sidewalk, etc) will need to be UV unwrapped within Blender. This will add a lot of unnecessary effort and time to a project.

If anyone has any advice on how to avoid UV unwrapping within Blender, please chime in...

Re: How to add texture image to mesh?

Posted: Sat May 22, 2010 10:18 pm
by GeoPappas
radiance wrote:blender does'nt apply an UV map to a plane, you need to unwrap it to apply an UV map first...
radiance:

Thanks for the response, but I'm not sure that I'm understanding what you are saying.

Just to clarify - I am trying to figure out how to get a mesh that has an image applied (without UV unwrapping) into Octane (from Blender 2.49b). For example, say I created a room and I apply a wood texture to the floor. I normally wouldn't UV unwrap the floor in order to apply the texture. I would just apply the texture. IMO, UV unwrapping the mesh would be extra work that wouldn't seem to add any value to the process. Other examples of this would be a textured wall, leather couch, concrete sidewalk, blacktop street, etc. I wouldn't normally UV unwrap these meshes to add a texture. (Maybe I'm doing this all wrong???)

I understand that Blender doesn't automatically apply a UV map. It is a manual process. But I am trying to see if that process can be avoided when exporting from Blender and importing into Octane.

Re: How to add texture image to mesh?

Posted: Sat May 22, 2010 10:20 pm
by GeoPappas
I have done some research and here is what I have found...

When I export the original Blender file (of the plane and image w/o UV unwrapping), the mesh (OBJ) file contains the following:

# Blender3D v249 OBJ File: sign_test.blend
# http://www.blender3d.org
mtllib sign_test.mtl
o Plane
v 7.000000 4.000000 0.000000
v 7.000000 -4.000000 0.000000
v -7.000001 -3.999999 0.000000
v -6.999998 4.000001 0.000000
vn 0.000000 0.000000 1.000000
usemtl Material.001
s off
f 1//1 4//1 3//1 2//1


But if I go back and UV unwrap the mesh, and export / import into Octane, it renders fine within Octane.

Here is what the mesh (OBJ) file looks like after the UV unwrapping (I have highlighted the differences in red boldface):

# Blender3D v249 OBJ File: sign_test2.blend
# http://www.blender3d.org
mtllib sign_test2.mtl
o Plane
v 7.000000 4.000000 0.000000
v 7.000000 -4.000000 0.000000
v -7.000001 -3.999999 0.000000
v -6.999998 4.000001 0.000000
vt 0.000000 0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.000000 1.000000

vn 0.000000 0.000000 1.000000
usemtl Material.001_sign_test.tif
s off
f 1/1/1 4/2/1 3/3/1 2/4/1


FYI: The material (MTL) files are exactly the same in both cases.

Someone correct me if I am wrong, but it seems that Octane is expecting the lines that contain the vt (texture coordinates) and also the f (face) information to include texture info.

I also read another thread (http://www.refractivesoftware.com/forum ... f=21&t=975) that seems to discuss this issue, but I tried the modified export script and it didn't help any.

Re: How to add texture image to mesh?

Posted: Sat May 22, 2010 10:52 pm
by radiance
yes, currently image maps are applied by UV coordinates, so they need to be applied,
we'll be adding additional mapping types (planar, cylindrical, etc.) in nest releases.

Radiance