Ogre::ManualObject - texture coord for Vector4

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
bishopnator
Gnome
Posts: 395
Joined: Thu Apr 26, 2007 11:43 am
Location: Slovakia / Switzerland
x 18

Ogre::ManualObject - texture coord for Vector4

Post by bishopnator »

Hi, I think, that Ogre::ManualObject should have method for adding texture coordinates as Ogre::Vector4. Ofcourse this method is useless for fixed pipeline, but for materials using vertex/fragment programs it is useful for adding special informations to vertices.
User avatar
bishopnator
Gnome
Posts: 395
Joined: Thu Apr 26, 2007 11:43 am
Location: Slovakia / Switzerland
x 18

Post by bishopnator »

also method for adding 4-component vector as vertex position should be useful.
User avatar
madmarx
OGRE Expert User
OGRE Expert User
Posts: 1671
Joined: Mon Jan 21, 2008 10:26 pm
x 51

Post by madmarx »

Hi,

Here is your answer :
http://www.ogre3d.org/phpBB2/viewtopic. ... 6f4e2718c6


Just to make sure, do you speak from the homogeneous coordinate system ?

what I mean by homogeneous coordinate system :

4-component vector as vertex position

-> infinite/finite positions. because a 4 component vector as vertex position as a very clear meaning : (a,b,c,d) is at the same position in space than (a/d,b/d,c/d, 1) if d!=0. If d==0 the point is at an infinite position along the vector a,b,c.

4-component texture coordinates

-> are also used in the fixe pipeline. You can't do everything you want with this because it has also an extremely clear meaning.
http://developer.nvidia.com/object/Proj ... pping.html
User avatar
nullsquared
Old One
Posts: 3245
Joined: Tue Apr 24, 2007 8:23 pm
Location: NY, NY, USA
x 11

Post by nullsquared »

madmarx, such things aren't just for the fixed function pipeline. People use normals, texture coordinates, etc. to pass program-defined data to the shader via the vertex attributes. For example, I can use a 4-component texture coordinate to pass some frustum information to my shader.
User avatar
madmarx
OGRE Expert User
OGRE Expert User
Posts: 1671
Joined: Mon Jan 21, 2008 10:26 pm
x 51

Post by madmarx »

I was just anwering to the :"useless for fixed pipeline", but well, you're right :oops:, i was not clear, even if I tried when I wrote "are also used in the fixe pipeline". sorry to explain :D
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

Yeah - you can already do this with vertex buffers of course. It's a fair request though, I'll queue it.
User avatar
bishopnator
Gnome
Posts: 395
Joined: Thu Apr 26, 2007 11:43 am
Location: Slovakia / Switzerland
x 18

Post by bishopnator »

Hi every one :)
madmarx:
I wrote 'useless for fixed pipeline' only for method for adding 4-component texture coord because it is impossible to create 4D texture. In programmable pipeline you can use xy components for looking into one texture and zw component into another textures (or you can use zw for different purpose).
Adding 4-component position is also good for using additional informations in 'w' component in vertex shaders. In fixed pipeline I am not sure if it has some usage - I never need it.
(nullsquared said the same as me - I had vacation so sorry for late answer).
Thanks sinbad for queueing these tasks.

Creating own vertex buffer (and vertex declaration) is possible but using ManualObject is easier - it handles also creating VertexData and IndexData :) :) :)
Post Reply