# Unity More Quake 3 map rendering problems

This topic is 2788 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi,

I'm still fighting to get Quake 3 maps rendered properly with Direct3D. As you can read here I have had serious problems with the Bezier patches. Well I didn't quite solve them I just switched to DirectX 10 and the artifacts disappeared. Also I stitched the subpatches together as jyk suggested.
But now I noticed some other problems:

First of all my texture and lightmap coordinates seem all to be wrong:
Texture and Lightmaps are off(Patches in Q3Dm17)
Quake 3 banner is mirrored(Q3Dm17)

The most obvious solution to this problem seemed like inverting the u-texcoord for all vertices:

vertex.texture = D3DXVECTOR2(1.0f - vertices.texCoord.x, vertices.texCoord.y);

But then this(Q3Ctf1, main room) will happen although the Quake 3 banner is rendered correctly.

Another problem which really distrubs me are certain artifacts(Q3Ctf1, flag room).

This happens when you look at the edges between patches and regular faces at a certain angle. You can see that the background is visible.

To sum this up:
-Texture and lightmap coordinates are wrong
-Strange artifacts

Please help me I'm really desperated to get this to work...

[Edited by - Soul Reaver on December 3, 2010 2:23:34 AM]

##### Share on other sites
If memory serves, q3a maps do have the lightmap uv coord stored explicitly. I'd say you're doing very wrong things with some alignments or vertex packings so they actually are "right" for coincidence more than everything else.

As for the banner: is this Q3DM17?
If it is, that piece of geometry did apply a shader. If the shader (as in Q3A .shader file) applied tcMod rotate (which is possible) then the texcoords will be all screwed. Did you check the shader?

Same thing for flames. Flames are animated and blended using Q3A shaders you have to parse. One of their features is that they can specify alpha maps independantly from diffuse RGB.
The flame shader in particular is likely additive, for which you correctly output black RGB as vertex color, but it seems the blendfunc is screwed up or the incorrect alpha is being supplied.

As for the final picture, what you're seeing is the typical flickering due to sub-pixel accuracy (a good thing) and FP errors (a bad thing).
Long story short: you must be sure patches are stitched correctly togheter, you cannot tassellate them independantly and hope to not experience that. Have a texture palette with "magnetic" vertices which you compare by some distance like (1/32, 1/64, values like that, on a per-group basis).

##### Share on other sites

the banner doesn't use a shader as far as I can tell, otherwise the application would fail to load the texture and it would appear black, also the effect int of that face equals -1 (just checked that).
Oh and what I meant with the other screenshot wasn't the flames but the texture above which is off if I invert the u-texcoord, if I leave it uninverted it is mapped correctly.

Quote:
 Have a texture palette with "magnetic" vertices which you compare by some distance like (1/32, 1/64, values like that, on a per-group basis).

Honestly, I don't get what you mean. Maybe because I don't know what a texture palette is. However I tried to solve this problem by a brute force attack (Just comparing each vertex with each other) a while ago. But as you can expect this resulted in very long load times and I don't even know anymore if it worked.

Oh and I am stitching the subpatches together, the problem is the transition between the patches and regular faces.

##### Share on other sites
Quote:
 Original post by Soul ReaverOh and I am stitching the subpatches together, the problem is the transition between the patches and regular faces.
Just a minor note (and this may or may not be the cause of the problem you're seeing), but be sure that you use the actual end control points for the first and last points of each Bezier curve, rather than evaluating the curve at t = 0 and t = 1 and using the result.

(Realistically, evaluating at exactly 0 and 1 is likely to return the first and last control points exactly, I think. But, depending on how you're computing t over the curve, you can easily end up with a value that's not quite 1 for the last point. Better to just avoid any such problems entirely and use the first and last control points as is, IMO.)

##### Share on other sites
Quote:
 Original post by Soul Reaverthe banner doesn't use a shader as far as I can tell, otherwise the application would fail to load the texture and it would appear black, also the effect int of that face equals -1 (just checked that).
Then this isn't q3dm17 or your assets are screwed. This screen in q3dm17 applies a shader. Just run ioquake or vanilla to check. If this isn't q3dm17 please say so, because it look pretty much like the screen just below the red armor.
Quote:
 Original post by Soul ReaverOh and what I meant with the other screenshot wasn't the flames but the texture above which is off if I invert the u-texcoord, if I leave it uninverted it is mapped correctly.
Would you please crank up the brightness? I'm still having difficulties. Are you referring to the black corner just below the jawbone to the top-left corner of the door?
Quote:
 Have a texture palette with "magnetic" vertices which you compare by some distance like (1/32, 1/64, values like that, on a per-group basis).
Sorry, my fault here. There's should have been no "texture" in the statement above. I really meant to write "vertex palette" rather than "texture palette".
Quote:
 Oh and I am stitching the subpatches together, the problem is the transition between the patches and regular faces.
Excuse me, I really couldn't figure that out. I'd say Jyk is probably hitting the correct solution then.

Do yo mind more elaborations on all your problems? For first, where are the shots taken (map and rough position)?

##### Share on other sites
Okay, I changed my function to use the control points when the parameter is close (EPSILON) to 1.0f or 0.0f. Unfortunately it didn't resolve the issue. Thanks for the good guess anyway.

EDIT: It is indeed Q3Dm17 but there is no shader applied. The other map is Q3ctf1 just in the main room. And yes I mean the black areas of the geometry just above the door. Oh I just realized that the inverting process of the texture coordinate isn't even the cause of the glitch (it also happens with uninverted texcoords). Also I changed AddressU to Mirror and this is what I get. I guess this is how it is supposed to be BUT on the other side of the map (the map is symetric) the same piece of geometry is still wrong.

EDIT2: Okay my fault, the inverting proccess IS the cause of the texture glitch in Q3ctf1 (Visual studio refused to rebuild the project and I didn't notice it). So to sum this up:

Uninverted + Wrap: Banner mirrored, texture above door correct (on both sides)
Inverted + Wrap: Banner is correct, texture above both doors is wrong
Inverted + Mirror: Banner is correct, texture above one door is correct, above the other it is wrong

Btw, I added the map name and locations in my first post for each screenshot.

[Edited by - Soul Reaver on December 3, 2010 5:07:36 AM]

1. 1
2. 2
Rutin
24
3. 3
4. 4
JoeJ
16
5. 5

• 14
• 29
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631775
• Total Posts
3002275
×