How to get a texture composed of a many textures in rect2D

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
Denis2014
Gnoblar
Posts: 3
Joined: Tue Apr 01, 2014 5:55 pm

How to get a texture composed of a many textures in rect2D

Post by Denis2014 »

Greeting,

it is with pleasure and with great expectancy to begin a new relationship with all of you on this forum. I'm pleasantly surprised to see the achievements made by your community with Ogre and I believe in your expertise. Unfortunately, I do not have your expertise and the same understanding of Ogre, and for these reasons I ask your cooperation to help me in my project using Ogre. In addition, I also occasionally solicit your indulgence, because my English is not as good as I would like.

Here is the reason of this topic:

Objective: Get a global texture from a 2D rectangle, I will apply thereafter on a surface of an object in the scene.

Global Texture: The texture that I will use from this 2D rectangle MUST be realized itself with different textures combined together according to specific positions in this rectangle 2D. (In fact, the combination of these textures composing my global texture varies depending on dimensions of my surface of the object.)

Example: In a rectangle2D, I have a texture that represents a photo. Around this rectangle, I want to created an illusion of a wooden frame made from 4 pieces of wood with a fixed width. To realize this illusion, I must use 4 new rectangles with texture of wood, one placed in the top, one in the bottom and one each sides of my 2D rectangle. Thereafter take the contents of the rectangle 2D to get a new texture (global texture) that I will apply on a surface of an object. (Here is a small example that well represents my need, but very often, the composition of this global texture is much more complex.)


Outcome: This allows me to create a different texture for each surface whose dimensions are different. Without this procedure ... the application of the common or unique texture to a larger or smaller area, disturb the illusion of width of the frame ... and that's what I really wish to avoid. It is very important that certain characteristics such as width, height, or offsets of textures that make up my global texture, always fix and determine at the time of my composition texture.

For now, I do not know the best approach to achieve this goal with Ogre. Since this goal is one of the most influential in my project and I want to be guided by your advice.

1. A whether on departure if the goal is achievable with a rect2D (or other way).
2. If so, they would be the steps to achieve this goal.


Thank you for your attention, and your valuable time that has no price. In order to share with you your passion for Ogre and this for a long time, it is a pleasure to contribute by offering monetary donation to your beautiful community.

Good day,
Last edited by Denis2014 on Sat May 17, 2014 11:16 pm, edited 1 time in total.
Denis2014
Gnoblar
Posts: 3
Joined: Tue Apr 01, 2014 5:55 pm

Re: How to get a texture composed of a many textures in rect

Post by Denis2014 »

Hi,

After a long solitary reflection and since I did not find a direct solution with Ogre. So, lack of resources, I then used the Windows GDI (pen, brush, easy drawing shape), it is flexible to create and save a texture bitmap. This done well objective mentioned above. :wink:
User avatar
shadowfeign
Goblin
Posts: 213
Joined: Mon Jan 26, 2009 11:51 pm
x 15

Re: How to get a texture composed of a many textures in rect

Post by shadowfeign »

do a search for texture atlas, it sounds like what you need.
Denis2014
Gnoblar
Posts: 3
Joined: Tue Apr 01, 2014 5:55 pm

Re: How to get a texture composed of a many textures in rect

Post by Denis2014 »

shadowfeign wrote:do a search for texture atlas, it sounds like what you need.

Thank, unfortunately no, I need to create textures dynamically with different brushes, textures, or both.
Post Reply