Hello,
I set a texture on a big plane with the following lines :
Code:
Image* image = osgDB::readImageFile(resources/textures/sable-jaune.bmp);
Texture2D* texture = new osg::Texture2D;
TexMat* tmat = new TexMat;
tmat-setMatrix(Matrix::scale(100,100,1));
if (image)
{
Hi Adrien,
On 6/10/10 18:07 , BARRAL Adrien wrote:
TexMat* tmat = new TexMat;
tmat-setMatrix(Matrix::scale(100,100,1));
...
Now, I enable my shaders programs, and my texture is scaled to the plane's
size (not repeated).
Here is my vertex shader :
Code:
...
gl_TexCoord[0] =
Thank you very much !!
That works fine, I just had to replace
Code:
gl_TexCoord[0] = gl_MultiTexCoord0;
by
Code:
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0*;
Cheers,
Adrien
--
Read this topic online here:
Oups...
That seems to work, but that doesn't work... In my previous post I made a
syntax error in my vertex shader, so the shader was disable, that's why my
texture was correctly displayed...
If I well understand, gl_MultiTexCoord0 contain the per vertex texture
coordinate 0 (I found that in
It's ok I finnaly find something that work, using the following lines :
Code:
gl_TexCoord[0].s = dot(gl_Vertex, gl_ObjectPlaneS[0]);
gl_TexCoord[0].t = dot(gl_Vertex, gl_ObjectPlaneT[0]);
End of the POST !
--
Read this topic online here:
,
dishing out texture IDs rather than reloading the texture onto card memory?
Kim.
From: [EMAIL PROTECTED] on behalf of Sukender
Sent: Wed 19/11/2008 15:53
To: OpenSceneGraph Users
Subject: Re: [osg-users] Texture Management
Hi Kim,
You may just use
Hi Kim,
On Thu, Nov 20, 2008 at 7:36 AM, Kim C Bale [EMAIL PROTECTED] wrote:
I've been pondering this Database pager. It only caches the image files into
memory to prevent loading during runtime doesn't it? Those are then used to
build textures on the card memory.
The DatabasePager doesn't
PROTECTED] On Behalf Of Sukender
Sent: 20 November 2008 08:54
To: OpenSceneGraph Users
Subject: Re: [osg-users] Texture Management BUMP
Hi Kim,
Well, if you load a model with its textures, the function will simply return
to you a pointer to an already existing model and/or texture (if cache
Cheers for clearing that up.
Kim.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Osfield
Sent: 20 November 2008 09:18
To: OpenSceneGraph Users
Subject: Re: [osg-users] Texture Management BUMP
Hi Kim,
On Thu, Nov 20, 2008 at 7:36 AM, Kim C
I have a number of different models in OSG format that all use the same
texture.
What I want to avoid is having duplicate textures loaded onto the
graphics card when I load these separate models. In previous programs I
have achieved this using a Texture Manager that manages all texture
Hi Kim,
You may just use the osgDB::Registry cache. That's automatic :)
For instance, set the cache by writing:
osgDB::ReaderWriter::Options* rwoptions = new
osgDB::ReaderWriter::Options;
rwoptions-setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_ALL);
Splendid. Thank you.
Kim.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sukender
Sent: 19 November 2008 15:53
To: OpenSceneGraph Users
Subject: Re: [osg-users] Texture Management
Hi Kim,
You may just use the osgDB::Registry cache. That's automatic
than reloading the texture onto card memory?
Kim.
From: [EMAIL PROTECTED] on behalf of Sukender
Sent: Wed 19/11/2008 15:53
To: OpenSceneGraph Users
Subject: Re: [osg-users] Texture Management
Hi Kim,
You may just use the osgDB::Registry cache. That's automatic
13 matches
Mail list logo