You are here

[Stainless] Technical info request thread

Pages

Errol's picture
Piledriver
Community VIPKickstarter BackerModerator
Posts: 962
[Stainless] Technical info request thread
#1 Submitted: Tue, 13/05/2014 - 13:36

As Trent, others and I are getting stuck into the internals of C:R I thought it would be handy to have a single place to post info requests for Stainless peeps to respond to. Please, keep this thread for technical information pertaining to modding!

I'll keep this first post for Q/A type overview stuff.

Edited by: Errol on 14/07/2015 - 13:22

:: You wanna build a snowman mod C:R? Get Flummery, the Carmageddon modders tool. ::
Making C:R mods happen since '14!

Errol's picture
Piledriver
Community VIPKickstarter BackerModerator
Posts: 962
Submitted: Tue, 13/05/2014 - 13:37

So, first things first...

Wonky UVs in self-saved MDL files:

I thought this was due to me side-stepping the trianglestrips by just exporting everything as individual triangles. Now I have trianglestrips in and it's still happening I'm beginning to think it's the final two floats in each vertex definition that are the cause.

The vertex data seems to be stored as:
Position.X
Position.Y
Position.Z
Normal.X
Normal.Y
Normal.Z
TexCoords.U
TexCoords.V
UNKNOWN.A
UNKNOWN.B
Colour.R
Colour.G
Colour.B
Colour.A

Could someone give me a clue as to what UNKNOWN.A and UNKNOWN.B are please?

[EDIT... ANSWER]
First, the missing values have absolutely nothing to do with the wonky UVs.
Second, they're a second pair of UVs used for either normal or lightmaps.

Edited by: Errol on Wed, 14/05/2014 - 18:06

:: You wanna build a snowman mod C:R? Get Flummery, the Carmageddon modders tool. ::
Making C:R mods happen since '14!

Harmalarm's picture
Cunning Stunt Licker
Community VIPKickstarter Backer
Posts: 119
Submitted: Tue, 13/05/2014 - 15:27

I suppose you parsed some files and found diffent kind of numbers for the UNKNOWN.A and B? My guess is that this is the second uv channel for lightmaps, normal maps or whatever it can be used for... Did you try pushing in random values to see a different UV result ingame? My guess is that it doesn't influence the first UV channel.

You also said it was every quad was wrong, and then the other quad had propper UV's again?

I've really given this a lot of thought but I can't think of anything going on here. I'm sure you triple checked your code?

Edited by: Harmalarm on Tue, 13/05/2014 - 15:30
Errol's picture
Piledriver
Community VIPKickstarter BackerModerator
Posts: 962
Submitted: Tue, 13/05/2014 - 15:50

Harmalarm wrote:
I suppose you parsed some files and found diffent kind of numbers for the UNKNOWN.A and B? My guess is that this is the second uv channel for lightmaps, normal maps or whatever it can be used for... Did you try pushing in random values to see a different UV result ingame? My guess is that it doesn't influence the first UV channel.

Yes to the first part and... unfortunately, yes to the second part. It doesn't look like these values are responsible for the messed up UVs either.

Harmalarm wrote:
You also said it was every quad was wrong, and then the other quad had propper UV's again?

I've really given this a lot of thought but I can't think of anything going on here. I'm sure you triple checked your code?

I've poked my code every which way and can't replicate the rendering issue in Flummery or prevent it happening in C:R. The same rendering issue happens on Trent's iOS C1 ports (these are MDLs already, not exported by Flummery) so I'm pretty sure it's not my code.

I have one idea left...
[EDIT] Using an MTL rather than an MT2 made no difference. Either this is an engine bug caused by extremely pointy triangles I've managed to replicate a bug in the iOS versions.

Edited by: Errol on Tue, 13/05/2014 - 16:01

:: You wanna build a snowman mod C:R? Get Flummery, the Carmageddon modders tool. ::
Making C:R mods happen since '14!

Dodo Bizar's picture
Norman E. Carnage
Kickstarter Backer
Posts: 94
Submitted: Tue, 13/05/2014 - 21:07

Errol, I believe there are similar errors currently in C:R itself, the current build. I found the same stretched faces somewhere in the bleak city map. I will report it to bugger and show the screen here tomorrow, not behind pc now. For anyone that wants to look for it, it is on one off the `feet` of the buildings. Part where you drive 5 meter above ground on a sort of ledge. Eastern side of map if I remember correctly. So it might be fundamental bug as well.

twisted's picture
Piledriver
Kickstarter Backer
Posts: 716
Submitted: Tue, 13/05/2014 - 22:51

I think I've seen it at numerous places in the current build. Looks like textures mapping coordinates are messed up on first pic. The second one is a similar bug but has nothing to do with textures...it's a rendering issue and can be seen only from a specific angle.


Edited by: TwIsTeDMiNd on Tue, 13/05/2014 - 23:26

lemonrev's picture
Velociraptor Fister
Kickstarter Backer
Posts: 1628
Submitted: Tue, 13/05/2014 - 23:53

TwIsTeDMiNd, Im thinking from your second pic that the car is almost horizontal to the lines you see on the side. Interesting that it just happens at that angle and none other.

Dodo Bizar's picture
Norman E. Carnage
Kickstarter Backer
Posts: 94
Submitted: Wed, 14/05/2014 - 17:23

Errol, Twistedmind, do you guys have Nvidia like me? I found a bug today in completely unrelated software that shows similar behaviour. It seems related to some of the new Nvidia hardware and drivers. Not all of them, the bug at my work only was found on 1 out of 4 PC's... the difference being Quadro 600 versusu Quadro K600 cards, the latter being the problem child. Perhaps this bug is completely unrelated and then this post should be removed since it is completely clogging up the actual topic. Perhaps I am onto something and this bug is ouy of the hands of C:R developers.

Errol's picture
Piledriver
Community VIPKickstarter BackerModerator
Posts: 962
Submitted: Wed, 14/05/2014 - 17:31

Hmz. I am on nvidia running the beta drivers.

:: You wanna build a snowman mod C:R? Get Flummery, the Carmageddon modders tool. ::
Making C:R mods happen since '14!

Dodo Bizar's picture
Norman E. Carnage
Kickstarter Backer
Posts: 94
Submitted: Wed, 14/05/2014 - 17:41

Me 2 Nvidia + beta drivers, here is link to my screens
http://steamcommunity.com/sharedfiles/filedetails/?id=259809442

Errol's picture
Piledriver
Community VIPKickstarter BackerModerator
Posts: 962
Submitted: Wed, 14/05/2014 - 18:05

It's in the same setup too, tight triangle causes the UVs to go wonky. Ok. I'm happy to just leave this as an engine bug and hope it gets fixed.

:: You wanna build a snowman mod C:R? Get Flummery, the Carmageddon modders tool. ::
Making C:R mods happen since '14!

Pages

randomness