Blender/Ogre only UV Mapped Textures?

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
grassi3000
Gnoblar
Posts: 11
Joined: Wed Mar 09, 2005 12:16 am

Blender/Ogre only UV Mapped Textures?

Post by grassi3000 »

Well during my time of Content creation, I only came accross UV Mapping that is displayed right in Ogre. That works very well for Characters, Items ...
but for Architecture it is nothing but inefficient and ugly (eg. a small game character (0.5m) standing near a 100m building that is mapped with one 1024x1024px texture.

So I wanted to make an ordinary texture (image) assign it to the building and repeat it.

When I export the whole thing into Ogre and look at the mesh file nothing about the repeat-x and repeat-y is stored.

Code: Select all

texture_unit
			{
				texture Haus_rechts_mitte.jpg
				tex_address_mode wrap
				filtering trilinear
			}
this is all written into the material file about the texture.

Is there any option how to do that?

thx
g3k
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

The repetition is done with the provided texture coordinates int the mesh. A texture is always mapped in [0..1] for the u and v coordinates, address mode wrap means, that if a uv coordinate of, say 1.2/3.4 is found it is actually mapped to the texel at 0.2/0.4.

So in order to make this work, you need to set UVs accordingly for your building. I don't know how to this in Blender though.
team-pantheon programmer
creators of Rastullahs Lockenpracht
grassi3000
Gnoblar
Posts: 11
Joined: Wed Mar 09, 2005 12:16 am

Post by grassi3000 »

so there is no way, to avoid uv mapping?

actually i tested this with a cube with 4 vertices, where the texture is repeated 4 times each side
http://stud4.tuwien.ac.at/~e0325080/Zeug/cube.png

So my question to all of the content creaters:
How do you texture a building with windows ... if not with repeating a texture?

If I uv Map every building as whole, only with a 1024x1024 (what in my case isn't enough, the buildings still would look blurred/pixeled) uvmap, and I have 6 building in the scene that would be a very high amount of texture data in the memory.
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Post by reimpell »

grassi3000 wrote:so there is no way, to avoid uv mapping?
None that I know of.
grassi3000 wrote:How do you texture a building with windows ... if not with repeating a texture?
Do the uv mapping on the segment before you extrude.
dermont
Bugbear
Posts: 812
Joined: Thu Dec 09, 2004 2:51 am
x 42

Post by dermont »

In blenders UV/Image Editor could you just scale the the UV coordinates to be larger than the image to achieve the desired tile effect and in the exported material definition add "tex_address_mode wrap" in the texture_unit
odyssey
Gnoblar
Posts: 13
Joined: Thu Mar 17, 2005 6:44 pm

Post by odyssey »

As well ..

In the Blender UV/Image Editor, you're able to constrain the scalar direction of the UV coords.

On a construct such as a building, a texture of 1024x1024 is unnecessary and even wasteful. Unless your character needs to see something in the joints and mortar between the brickwork, keep these larger material sizes for terrain.

You mentioned a building with windows.
Yes, you can create a brick-and-window texture-map and slap it on each face; all UV aficionados begin this way. What you begin to find out though is the UV coords themselves are modifiable (in terms of size and position).

What this means to you is you're not constrained to use the entirety of your texture-map, but individual pieces of it. Lets take the example of a brick wall with a window..

This is very quick and dirty ..

In Blender create a plane mesh; in Edit mode duplicate and move those vertices (from left to right) so you end up with a mesh that's essentially 3 planes wide and 1 high.
Enter UV mode..
On the left and right planes slap your brick texture. On the middle plane place your window texture; depending on how well the seamlessness is developed on the texture you can drop and apply to the mesh with little tweaking of the UV coords.

When I need to create a building wall I first draw the placement of whatever breaks up the wall face and finally split the mesh plane accordingly, permitting me to place bare stone or brick as needed and windows and sills too.

:)
Rash Overdrive
Gnoblar
Posts: 2
Joined: Wed May 04, 2005 9:52 am

Post by Rash Overdrive »

Do any of you know if it is possible to assign multiple uv coordinates in blender?
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

It isn't yet afaik. But this is a feature being worked on.
team-pantheon programmer
creators of Rastullahs Lockenpracht
ibrown
Gremlin
Posts: 164
Joined: Wed Aug 18, 2004 6:41 pm
Location: London
Contact:

Post by ibrown »

Rash Overdrive wrote:Do any of you know if it is possible to assign multiple uv coordinates in blender?
How do you mean?
UV coordinates can be applied to vertices or to individual faces. If you apply them to a face then a single vertex can have muliple UV coords (one set for each face it is assigned to).
Is this what you mean?

It's in the user manual about this...

Ian
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

Don't think this is meant. :) Per face UVs have different purpose than multiple per vertex UVs have. Per face UVs don't allow to use multiple texture units to have different UVs.
team-pantheon programmer
creators of Rastullahs Lockenpracht
ibrown
Gremlin
Posts: 164
Joined: Wed Aug 18, 2004 6:41 pm
Location: London
Contact:

Post by ibrown »

ah - I see. You mean putting more than one texture on a face, with each texture having its own UV set. That would make sense.

I learn something new each day. With Blender, it seems to be about 100 things each day sometimes :)

Ian
Post Reply