Transformed but unlit vertex

Started by
7 comments, last by Darkening 23 years, 10 months ago
Is it possible to have a vertex format which is transformed but is not lit ? Darkening
---------------------------Unfortunately, no one can be told what a bug is.You have to see it for yourself...
Advertisement
So you want D3D to light your transformed vertex? I think that''s possible. Your FVF description would be something like D3DFVF_XYZRHW / D3DFVF_NORMAL / D3DFVF_TEX1. It''s probably not a good idea, though -- D3D will have to "back-transform" the vertex to world-space in order to light it, which kinda defeats the purpose of transforming the vertex before-hand.
Im confused on what exactly you are looking to do. If you want to do your own transforms then the above post covered it. If you are looking to do you own lighting then:

The 'Flexible Vertex Format' you need is D3DFVF_LVERTEX.

By using this format, you have to supply the lighting information in the color and specular variables.


typedef struct _D3DLVERTEX {
union {
D3DVALUE x;
D3DVALUE dvX;
};
union {
D3DVALUE y;
D3DVALUE dvY;
};
union {
D3DVALUE z;
D3DVALUE dvZ;
};
DWORD dwReserved;
union {
D3DCOLOR color;
D3DCOLOR dcColor;
};
union {
D3DCOLOR specular;
D3DCOLOR dcSpecular;
};
union {
D3DVALUE tu;
D3DVALUE dvTU;
};
union {
D3DVALUE tv;
D3DVALUE dvTV;
};
} D3DLVERTEX, *LPD3DLVERTEX;








"You know you're obsessed with computer graphics when you're outside and you look up at the trees and think, "Wow! That's spectacular resolution!""




Edited by - emfb on June 15, 2000 1:18:15 AM

"You know you're obsessed with computer graphics when you're outside and you look up at the trees and think, "Wow! That's spectacular resolution!""
What I want to do, is use the lightning system of Direct3D but not it''s transform system.
I''m not good enough with all the matrix to use the transform pipeline.
What I want is a dynamic lightning system. I have an isometric engine using D3DTLVERTEX and I want to add dynamic lightning in it.

Darkening
---------------------------Unfortunately, no one can be told what a bug is.You have to see it for yourself...
If I use a lightmap, would DirectX need to "back-transform" the vertex to world space ?

Darkening
---------------------------Unfortunately, no one can be told what a bug is.You have to see it for yourself...
I don''t think so. Isn''t a lightmap just a special type of texture?

I think the DirectX lighting engine just calculates light components of vertices -- it doesn''t do anything with lightmaps. I''m hardly an expert, though...
When you use a light map you just apply another texture to the polygons. There is no lightning calculation by DirectX necessary if you use lightmaps. Maybe some ambient lightning.
Yoshi
The last truth is that there is no magic(Feist)
I''d like to see this TVERTEX too: the normal (untransformed) lightning effects are imo better than the ones used in transforming.
You could perform your own lighting by coloring the vertex with the correct diffuse value. You wouldn't get specular colors, but then again, I don't see grass with a high specular reflection

D3DF_XYZRHW / D3DF_DIFFUSE

struct myvert
{
float x,y,z,w;
DWORD color;
};


Edited by - mitchw on June 15, 2000 10:26:28 AM

This topic is closed to new replies.

Advertisement