Chris
Member
|
RE: Textures & Scene Modification
Thanks, I tried this already but it wasn't it. Darn, i've been stuck on this for 5 hours already. Pretty difficult to debug.
Do you think this may have anything to do with this:
If I project an objects texture coordinates into 3d space (part of the code i'm using in my mesh recreation maths), I get parts of them drawed on two sides of the 2d space - I can't get my head around as to why it's like this.
Edit: I solved the original problem, it was from poorly converted texture coordinates.
(This post was last modified: 05-10-2010 06:16 PM by Chris.)
|
|
05-05-2010 03:14 PM |
|
Chris
Member
|
RE: Textures & Scene Modification
Sorry to keep asking questions on this.
Do you know how I can access the 3d position of a pixel, in the pixel shader, even if its been previously changed in a vertex shader? i.e. you have, in a pixel shader:
Vec2 inTex: TEXCOORD0,
Vec inPos: TEXCOORD1,
texture_color = TransformPos(inPos);
however only inPos.x and inPos.y seem to contain relevant data, as i've previously projected the vertex to a 2d position.
I basically want to write a shader which sets the colour of each pixel to be the local 3d object space surface colour. But in my case, the vertex position has previously been changed to a 2d position - i.e. to a uv projection of the mesh.
Any ideas? Sorry if i'm not being clear enough.
Thanks for your huge help already,
Chris
|
|
05-10-2010 06:27 PM |
|
Esenthel
Administrator
|
RE: Textures & Scene Modification
but from uv you get the 3D pos right?
so you need to pass this 3D as additional TEXCOORD (for example out Vec outPos:TEXCOORD3 in vertex shader function)
|
|
05-10-2010 06:30 PM |
|
Chris
Member
|
RE: Textures & Scene Modification
Ah, so that's how that works
Thanks, this should be okay now!
|
|
05-10-2010 06:33 PM |
|