Results 1 to 4 of 4

Thread: Strange in-game rendering with replacement .skd models

  1. #1

    Default Strange in-game rendering with replacement .skd models

    Hello!

    I'm helping out a friend with some 3D modelling and new textures for his MoH:AA mod. I'm new to modding this game, and am hitting some problems when trying to replace some of the .skd static model files (I'm not editing maps, just model files and textures). Maybe one of you guys can offer some advice on what I'm doing wrong?

    The problem I'm having seem like it could be similar to this one:
    https://www.x-null.net/forums/thread...olygon-shadows
    ...but maybe not. In the game, the new model renders with strange shading.

    I'm making new models and UV maps in Blender, then exporting as .obj files. Then I import the game's original .skd & .skc files (for the model I want to replace) into LightRay3D, so that I have the material and "bone" object for it. In LR3D, I delete the original skin and model, import the new .obj model, update the material with the new texture, assign the material to the model, convert it to a skin, edit the skin vertices (add them to the bone object and give them a weight of 1.0), then export the skin as a .skd & .skc file with the default export settings. Then place the .skd, .skc and texture files into the appropriate folder structure inside a zzzzzzz-XXXXXX.pk3 mod file.

    Here's an example:

    Blender model - looks fine :
    Blender.JPG


    Imported model in LR3D (this one has 956 TVerts) - looks fine :
    LR3D.png

    ...and in-game - looks bad!
    in-game.png

    The strange thing is, if I shoot the model in-game, the weird shading disappears for an instant when the bullets hit (or maybe it's the muzzle flash?)...
    in-game2.png

    I've tried changing the texture rendering settings for this model in the relevant shader files (submodels.shader & das_boot.shader), and managed to make it render without the weird shading, but then it has no shading at all.
    in-game3.jpg

    Shader code I tried:
    Code:
    textures/das_boot/atlas-echolot
    {
    	qer_editorimage textures/das_boot/atlas-echolot.tga
    	{
    		map textures/das_boot/atlas-echolot.tga
    		rgbGen identityLighting
    	}
    }
    (I'm not a programmer, so am just guessing with the shader settings, after reading some guidance, most of which I don't understand...)

    As the game's original model renders ok with the original shader settings, I'm now thinking the problem is probably with the new model, its material settings or the exported .skd file?

    I appreciate any suggestions you can offer

  2. #2

    Default

    the same happens when you spawn a static model on the fly with a mod
    the shader affects how the lighting is applied on that models, which for static models happens when the map is compiled
    I'm not sure if it possible to just replace a static model and expect it to look good without recompiling the map
    but have you tried using the exac same shader from the original model?
    maybe using "rgbGen lightingSpherical" instead of "rgbGen identityLighting" might help but I don't really know

  3. #3

    Default

    Try reducing the number of faces that converge into a sigle point in the model, like here where most of the faces have their edges on the corner of the square surface and then they form the circular structure of the holes in your model.

    Or you can make a solid cube and add a shader that makes parts of the texture invisible and then you add the holes where the invisible parts are located.

  4. #4

    Default

    Apologies for the late reply here!

    Thanks to both of you for the information and suggestions.

    @Zappa - I thought I'd already tried to use "rgbGen lightingSpherical", but obviously I hadn't as the model rendered nicely with that shader command! Many thanks for that!

    in-game.jpg

    @Soares93 - I know what you're saying, and did wonder if that could have been a contributing factor... The method I've used to triangulate the front face of the model is what was taught to me by a friend of mine who's a very experienced 3D modeller as the "pro" way to get the right topology for a flat surface which contains holes (and this model has 5 holes in the front surface, hence the needs for some many faces) -in order to avoid smoothing problems when rendered.
    Interesting suggestion to use an alpha mask to make the holes - I will bear that method in mind in future

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •