Rendering with my Direct3D engine
I have a little problem that I don''t know what to do with.
I have my 3D engine and I wan''t to render with lightmaps.
So I need a different lightmap (texture) for every polygon.
So do I need to render one polygon at a time so that I can change the current texture and lightmap for every polygon?
I use Direct3D with DrawPrimitive.
You can't always trust me
That depends...
If you want to use multipass rendering you can draw all your polygons with texture,
then change the blending mode and draw all polygons again with the lightmap.
But with multitexturing you probably have to draw one polygon at a time.
Greets Tobias
If you want to use multipass rendering you can draw all your polygons with texture,
then change the blending mode and draw all polygons again with the lightmap.
But with multitexturing you probably have to draw one polygon at a time.
Greets Tobias
But isn''t that extremely slow?
Is there anyone that has any experience with this problem?
How do you people render with your Direct3D engine?
Do you render one polygon at the time?
You can't always trust me
Is there anyone that has any experience with this problem?
How do you people render with your Direct3D engine?
Do you render one polygon at the time?
You can't always trust me
Correct me if I am wrong, but I believe that you can set up your verts with an extra pair of texture uv coordinates that are used for your lightmaps. You can then set one of the rendering stages to use lightmaps and render as normal.
PS. This is just off the top of my head from what I remember so I may be wrong.
PS. This is just off the top of my head from what I remember so I may be wrong.
---Ranok---
Also check that your texture coordinantes are set properly or that the filter modes are correctly set. That fixed my problem with my light maps. I use 2 sets of textures for multitexturing instead of multipass. Multipass is slow and requires unnecessary alphablending and poly rendering.
I was not aware that you could use multiple texture coordinantes, but you can. In the DX7 Help go to
Direct3D/Direct 3D IM/Essentials/Vertex Formats/About Vertex Formats.
I was not aware that you could use multiple texture coordinantes, but you can. In the DX7 Help go to
Direct3D/Direct 3D IM/Essentials/Vertex Formats/About Vertex Formats.
I do use multiple texture coordinates but I can only use the SetTexture method between every DrawPrimitive call and I use multitexturing in D3D and since EVERY polygon has it''s own specific lightmap I need to change the texture every frame and that means I need to do one DrawPrimitive call for every polygon.
If I didn''t use multiple texture coordinates things would be strange.
If I didn''t use multiple texture coordinates things would be strange.
Use DrawIndexedPrimitive and VertexBuffers instead, that way the vertices will only be transformed once.
You could use the same lightmap for several polygons, even if they aren't in the same plane. The polygons just use different parts of the lightmap texture. That way you will save a few texture swaps. Which is always a good thing. =)
A lot of swedes on this question isn't? =)
Edited by - Spellbound on 2/8/00 12:31:01 PM
You could use the same lightmap for several polygons, even if they aren't in the same plane. The polygons just use different parts of the lightmap texture. That way you will save a few texture swaps. Which is always a good thing. =)
A lot of swedes on this question isn't? =)
Edited by - Spellbound on 2/8/00 12:31:01 PM
So spellbound do you mean I should use one big texture containing all lightmap info and just change the texture coordinates according to how I wan''t my lightmap to look?
Otherwise I see no other solution but to use the solution I talked about before, especially if I wan''t a different base texture for every polygon.
Otherwise I see no other solution but to use the solution I talked about before, especially if I wan''t a different base texture for every polygon.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement