Object missing required vertex for a material

Your forum for all discussions around Modding.
JDMFarms
Posts: 168
Joined: Sun May 08, 2016 8:58 pm

Re: Object missing required vertex for a material

Post by JDMFarms »

to be frank, im not even sure what benefits came with 3.0 when we upgraded last year. my coworkers and i did notice and report to eachother the differences but today, in a grander scheme, they were trivial. so, BL: you are not missing much, i guess.
TheSuBBie
Posts: 538
Joined: Wed Jun 10, 2020 11:38 am

Re: Object missing required vertex for a material

Post by TheSuBBie »

Your objects are using the assets/lights /lizard, the lights i3d of your truck are combined as a single mesh (backlightStatic )in maya/Blender when creating the various parts of the final model

If you look in the folder you wil see that the rear lights use the front light i3ds via the relevant xml's (backLight oval.xml etc)
Colours are controlled by the vehicle shader which has preset lines for different (colorMat0-colorMat7)

Code: Select all

this for the rear lights
<Material name="truckMLightsShared_mat1" materialId="3" diffuseColor="0.5 0.5 0.5 1" cosPower="100" specularColor="1 1 1" ambientColor="1 1 1" alphaBlending="true" customShaderId="3" customShaderVariation="staticLight">
      <CustomParameter name="colorMat2" value="0.5 0 0 2"/>
      <CustomParameter name="colorMat0" value="1.0 1.0 1.0 2"/>
      <CustomParameter name="colorMat1" value="1 0.25 0 2"/>
      <Normalmap fileId="20"/>
      <Glossmap fileId="21"/>
    </Material>
Upshot is you can use the lights i3ds to create your own set up although unless you combine them there will be two backlightStatic entries in the i3d and xml

The reason they are not indicated in the main i3d is they are part of the main model and not separate i3d's
JDMFarms
Posts: 168
Joined: Sun May 08, 2016 8:58 pm

Re: Object missing required vertex for a material

Post by JDMFarms »

SuBBie,

the xml files are very basic. this folder leaves me to believe these are all dynamically loaded parts. I'm still finding it hard to imagine how my light system points to this folder at all.

I tried to use the redRound_01 and point the following to it in the i3dmapping section. It didnt work which is probably due to me using the object for what it wasnt designed for.

I believe this is the line in the veh.xml that activate the taillights (U.S. slang for rear running/back lights).

Code: Select all

<defaultLight shaderNode="backlightStatic" lightTypes="0"/>

to make sure we are talking about the same light shapes and materials and such, here is the i3d i exported from the road runner. I then opened this i3d and exported shape by shape to wavefront.obj to adjust xyz translations of select facegroups/polygroups in Blender.

specific item of discussion is mat14 and shape6; this shape contains front/side/rear light filters/lenses/covers (amber/red/clear).

Code: Select all

<?xml version="1.0" encoding="iso-8859-1"?>
<i3D name="truckL" version="1.6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://i3d.giants.ch/schema/i3d-1.6.xsd">
    <Asset>
        <Export program="GIANTS Editor 64bit" version="8.2.2"/>
    </Asset>
    <Files>
        <File fileId="4" filename="$data/shaders/vehicleShader.xml"/>
        <File fileId="8" filename="$data/shared/clearPlastic_diffuse.png"/>
        <File fileId="2" filename="$data/vehicles/lizard/truckM/truckMLightsShared_normal.png"/>
        <File fileId="3" filename="$data/vehicles/lizard/truckM/truckMLightsShared_specular.png"/>
    </Files>
    <Materials>
        <Material name="clearPlastic_mat" materialId="14" alphaBlending="true" customShaderId="4" customShaderVariation="staticLight">
            <Texture fileId="8"/>
            <Normalmap fileId="2"/>
            <Glossmap fileId="3"/>
            <CustomParameter name="RDT" value="1 1 0 0"/>
            <CustomParameter name="dirtColor" value="0.2 0.14 0.08 0"/>
            <CustomParameter name="colorMat0" value="1 1 1 2"/>
            <CustomParameter name="colorMat1" value="1 0.25 0 2"/>
            <CustomParameter name="colorMat2" value="0.5 0 0 2"/>
            <CustomParameter name="colorMat3" value="0.1 0.1 1 1"/>
            <CustomParameter name="colorMat4" value="1 1 0.1 1"/>
            <CustomParameter name="colorMat5" value="0.05 0.05 0.05 1"/>
            <CustomParameter name="colorMat6" value="1 0.1 1 1"/>
            <CustomParameter name="colorMat7" value="0.1 1 1 1"/>
            <CustomParameter name="lightControl" value="0 0 0 0"/>
            <CustomParameter name="blinkOffset" value="0 0 1 0"/>
        </Material>
        <Material name="truckMLightsShared_mat" materialId="13" diffuseColor="0.498039 0.498039 0.498039 1" customShaderId="4" customShaderVariation="colorMask">
            <Normalmap fileId="2"/>
            <Glossmap fileId="3"/>
            <CustomParameter name="RDT" value="1 1 0 0"/>
            <CustomParameter name="dirtColor" value="0.2 0.14 0.08 0"/>
            <CustomParameter name="colorMat0" value="1 1 1 2"/>
            <CustomParameter name="colorMat1" value="1 0.25 0 2"/>
            <CustomParameter name="colorMat2" value="0.5 0 0 2"/>
            <CustomParameter name="colorMat3" value="0.1 0.1 1 1"/>
            <CustomParameter name="colorMat4" value="1 1 0.1 1"/>
            <CustomParameter name="colorMat5" value="0.05 0.05 0.05 1"/>
            <CustomParameter name="colorMat6" value="1 0.1 1 1"/>
            <CustomParameter name="colorMat7" value="0.1 1 1 1"/>
        </Material>
        <Material name="truckMLightsShared_mat1" materialId="15" diffuseColor="0.498039 0.498039 0.498039 1" alphaBlending="true" customShaderId="4" customShaderVariation="staticLight">
            <Normalmap fileId="2"/>
            <Glossmap fileId="3"/>
            <CustomParameter name="RDT" value="1 1 0 0"/>
            <CustomParameter name="dirtColor" value="0.2 0.14 0.08 0"/>
            <CustomParameter name="colorMat0" value="1 1 1 2"/>
            <CustomParameter name="colorMat1" value="1 0.25 0 2"/>
            <CustomParameter name="colorMat2" value="0.5 0 0 2"/>
            <CustomParameter name="colorMat3" value="0.1 0.1 1 1"/>
            <CustomParameter name="colorMat4" value="1 1 0.1 1"/>
            <CustomParameter name="colorMat5" value="0.05 0.05 0.05 1"/>
            <CustomParameter name="colorMat6" value="1 0.1 1 1"/>
            <CustomParameter name="colorMat7" value="0.1 1 1 1"/>
            <CustomParameter name="lightControl" value="0 0 0 0"/>
            <CustomParameter name="blinkOffset" value="0 0 1 0"/>
        </Material>
    </Materials>
    <Shapes externalShapesFile="lightSet.i3d.shapes"/>
    <Dynamics/>
    <Scene>
        <TransformGroup name="lights" translation="0 0 -2.84217e-16" nodeId="77">
            <TransformGroup name="staticLights" nodeId="78">
                <Shape shapeId="1" name="turnlightStaticRight" translation="-5.6503e-16 3.17215 0.922764" rotation="0 180 0" clipDistance="35" nodeId="79" materialIds="15" castsShadows="true" receiveShadows="true" decalLayer="1"/>
                <Shape shapeId="2" name="turnlightStaticLeft" translation="-5.6503e-16 3.17215 0.922764" rotation="0 180 0" clipDistance="35" nodeId="80" materialIds="15" castsShadows="true" receiveShadows="true" decalLayer="1"/>
                <Shape shapeId="3" name="reverseLightStatic" translation="-3.39018e-16 3.17215 0.922764" rotation="0 180 0" clipDistance="35" nodeId="81" materialIds="15" castsShadows="true" receiveShadows="true" decalLayer="1"/>
                <Shape shapeId="4" name="backlightStatic" translation="6.66131e-16 0.920761 -5.43937" rotation="0 180 0" clipDistance="35" nodeId="82" materialIds="15" castsShadows="true" receiveShadows="true" decalLayer="1"/>
                <Shape shapeId="5" name="frontlightStatic" translation="-4.25292e-16 1.26632 3.47277" rotation="0 180 0" clipDistance="35" nodeId="83" materialIds="15" castsShadows="true" receiveShadows="true" decalLayer="1"/>
            </TransformGroup>
            <TransformGroup name="defaultLights" nodeId="84">
                <Light name="frontLightLow" translation="7.10543e-17 1.51809 3.83721" rotation="165 0 -180" clipDistance="75" nodeId="85" type="spot" color="0.85 0.85 1" emitDiffuse="true" emitSpecular="true" decayRate="1" range="20" coneAngle="80" dropOff="3"/>
                <Light name="highBeamLow" translation="1.42109e-16 1.42889 3.81744" rotation="170 -8.82781e-32 180" clipDistance="75" nodeId="86" type="spot" color="0.85 0.85 1" emitDiffuse="true" emitSpecular="true" decayRate="1" range="30" coneAngle="70" dropOff="2"/>
                <Light name="frontLightHigh" translation="-0.706332 1.51809 3.84706" rotation="165 8 180" clipDistance="75" nodeId="87" type="spot" color="0.85 0.85 1" emitDiffuse="true" emitSpecular="true" decayRate="1" range="25" coneAngle="70" dropOff="3">
                    <Light name="frontLightHigh1" translation="-1.70359 -0.0619674 0.231265" rotation="0 16 0" clipDistance="75" nodeId="88" type="spot" color="0.85 0.85 1" emitDiffuse="true" emitSpecular="true" decayRate="1" range="25" coneAngle="70" dropOff="3"/>
                </Light>
                <Light name="highBeamHigh" translation="-0.826307 1.42889 3.82136" rotation="170 5 180" clipDistance="75" nodeId="89" type="spot" color="0.85 0.85 1" emitDiffuse="true" emitSpecular="true" decayRate="1" range="35" coneAngle="50" dropOff="2.5">
                    <Light name="highBeamHigh1" translation="-1.82418 -0.0277133 0.15717" rotation="0 10 0" clipDistance="75" nodeId="90" type="spot" color="0.85 0.85 1" emitDiffuse="true" emitSpecular="true" decayRate="1" range="35" coneAngle="50" dropOff="2.5"/>
                </Light>
            </TransformGroup>
            <TransformGroup name="turnLights" nodeId="91">
                <Light name="turnLightLeftBack" translation="1.0158 0.955084 -5.53753" rotation="-8 -5 0" clipDistance="75" nodeId="92" type="spot" color="0.5 0 0" emitDiffuse="true" emitSpecular="true" decayRate="1" range="4" coneAngle="140" dropOff="3"/>
                <Light name="turnLightRightBack" translation="-1.05927 0.955084 -5.53753" rotation="-8 5 0" clipDistance="75" nodeId="93" type="spot" color="0.5 0 0" emitDiffuse="true" emitSpecular="true" decayRate="1" range="4" coneAngle="140" dropOff="3"/>
                <Light name="turnLightLeftFront" translation="1.00402 1.21835 3.76315" rotation="0 185 0" clipDistance="75" nodeId="94" type="spot" color="0.31 0.14 0" emitDiffuse="true" emitSpecular="true" decayRate="1" range="4" coneAngle="140" dropOff="3">
                    <Light name="turnLightLeftFront1" translation="-0.512174 0.63321 1.91333" rotation="-22.6075 29.2539 -2.11211" clipDistance="75" nodeId="95" type="spot" color="0.31 0.14 0" emitDiffuse="true" emitSpecular="true" decayRate="1" range="4" coneAngle="140" dropOff="3"/>
                </Light>
                <Light name="turnLightRightFront" translation="-0.980846 1.21835 3.76315" rotation="0 175 0" clipDistance="75" nodeId="96" type="spot" color="0.31 0.14 0" emitDiffuse="true" emitSpecular="true" decayRate="1" range="4" coneAngle="140" dropOff="3">
                    <Light name="turnLightRightFront1" translation="0.517205 0.682376 1.91333" rotation="-22.7475 -32.4579 2.18393" clipDistance="75" nodeId="97" type="spot" color="0.31 0.14 0" emitDiffuse="true" emitSpecular="true" decayRate="1" range="4" coneAngle="140" dropOff="3"/>
                </Light>
            </TransformGroup>
            <TransformGroup name="backLights" nodeId="98">
                <Light name="backLightsHigh1" translation="0.732798 0.817459 -5.55243" rotation="-15 20 0" clipDistance="75" nodeId="99" type="spot" color="0.5 0 0" emitDiffuse="true" emitSpecular="true" decayRate="1" range="2.5" coneAngle="170" dropOff="2">
                    <Light name="backLightsHigh2" translation="-1.79683 0.169266 -0.631709" rotation="0 -40 0" clipDistance="75" nodeId="100" type="spot" color="0.5 0 0" emitDiffuse="true" emitSpecular="true" decayRate="1" range="2.5" coneAngle="170" dropOff="2"/>
                </Light>
            </TransformGroup>
            <TransformGroup name="reverseLights" nodeId="101">
                <Light name="reverseLight" translation="6.39488e-16 0.986105 -5.63431" rotation="-15 0 0" clipDistance="75" nodeId="102" type="spot" color="0.9 0.9 1" emitDiffuse="true" emitSpecular="true" decayRate="1" range="5" coneAngle="150" dropOff="3">
                    <Light name="reverseLight1" translation="0 0.424809 4.05245" clipDistance="75" nodeId="103" type="spot" color="0.9 0.9 1" emitDiffuse="true" emitSpecular="true" decayRate="1" range="5" coneAngle="150" dropOff="3"/>
                </Light>
            </TransformGroup>
            <TransformGroup name="visuals" nodeId="104">
                <Shape shapeId="6" name="lightsGlassStatic" translation="1.19918e-16 2.25252 -0.979201" rotation="0 180 0" clipDistance="35" nodeId="105" materialIds="14" castsShadows="true" receiveShadows="true" decalLayer="1"/>
                <Shape shapeId="7" name="lights" translation="-1.13006e-16 3.17215 0.922764" rotation="0 180 0" clipDistance="300" nodeId="106" materialIds="13" castsShadows="true" receiveShadows="true"/>
                <Shape shapeId="8" name="dekolightStatic" translation="1.19999e-16 2.24791 -0.97987" rotation="0 180 0" clipDistance="35" nodeId="107" materialIds="15" castsShadows="true" receiveShadows="true" decalLayer="1"/>
            </TransformGroup>
        </TransformGroup>
    </Scene>
</i3D>

TheSuBBie
Posts: 538
Joined: Wed Jun 10, 2020 11:38 am

Re: Object missing required vertex for a material

Post by TheSuBBie »

Slightly confused at the moment with what you are trying to do.

If you want to create a new set of lights then simply import the relevent light asset from the assests/lights folder and place it in the truck i3d adjusting size position accordingly (color can be changed by adjusting the relevant shader value) add the light source and adjusting the xml settings values as necessary.
The allLights.png shows all the light variations available.

Treat the lights as a mesh with texture/shader applied like any normal model that starts with importing extra's i3ds and then saving the whole i3d as one mesh each separate mesh in the Scenegraph of that model has its own texture/shader applied to it, a dynamically loaded part is a separate complete i3d file
JDMFarms
Posts: 168
Joined: Sun May 08, 2016 8:58 pm

Re: Object missing required vertex for a material

Post by JDMFarms »

i learn best by taking something that works and dissect it from there. reverse engineer, so to speak. Then i can have the foundation to build something from scratch. THat is for using other peoples systems. So what i did was opened the Roadrunner (working example) in GE, selected the parent light transfrom in scenegraph, exported all with support files. then imported it into my vehicle. copied the lights lines from the roadrunner.xml and pasted in my veh.xml. got it working. learned the basic light system. now placing the various lights on the correct xyz on my truck. that required xporting the shapes to blender to relocate them on my truck. exported to i3d...learned a lot about the materials/textures/shaders interactions. So far, all have worked except one item on the one shape. that shape has front amber lenses, rear red lenses, amber side marker lenses, top marker amber lenses, rear red lenses, and clear rear lenses.

im confident if i figure this out on this way of doing it, i can better understand how to model from scratch.
User avatar
Dogface
Posts: 1062
Joined: Mon Nov 28, 2016 3:02 pm
Location: PC ⛽ USA

Re: Object missing required vertex for a material

Post by Dogface »

I would ask to look at the mod, but I don't seem to be able to open a FS19 mods. Just curious, why are you using FS19?
User avatar
Dogface
Posts: 1062
Joined: Mon Nov 28, 2016 3:02 pm
Location: PC ⛽ USA

Re: Object missing required vertex for a material

Post by Dogface »

I got the FS19 roadrunner to open! :smileynew:

The back lights are made up of three parts:
- staticLights
- lightsGlassStatic (under visuals)
- lights (under visuals)

I suggest you look at the Material for each one (they each have a different Material), in the base game i3D. Once you understand that, it should be easier to replicate it in your modded version.

DISCLAIMER: it is hard to tell what the problem is, so Materials is just a best guess. But, wrong color would suggest UV or Materials.
TheSuBBie
Posts: 538
Joined: Wed Jun 10, 2020 11:38 am

Re: Object missing required vertex for a material

Post by TheSuBBie »

If you just select and export the backLightStatic mesh the i3d looks like this

Code: Select all

<?xml version="1.0" encoding="iso-8859-1"?>
<i3D name="truckL" version="1.6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://i3d.giants.ch/schema/i3d-1.6.xsd">
    <Asset>
        <Export program="GIANTS Editor 64bit" version="8.2.2"/>
    </Asset>
    <Files>
        <File fileId="4" filename="$data/shaders/vehicleShader.xml"/>
        <File fileId="2" filename="$data/vehicles/lizard/truckM/truckMLightsShared_normal.png"/>
        <File fileId="3" filename="$data/vehicles/lizard/truckM/truckMLightsShared_specular.png"/>
    </Files>
    <Materials>
        <Material name="truckMLightsShared_mat1" materialId="15" diffuseColor="0.498039 0.498039 0.498039 1" alphaBlending="true" customShaderId="4" customShaderVariation="staticLight">
            <Normalmap fileId="2"/>
            <Glossmap fileId="3"/>
            <CustomParameter name="RDT" value="1 1 0 0"/>
            <CustomParameter name="dirtColor" value="0.2 0.14 0.08 0"/>
            <CustomParameter name="colorMat0" value="1 1 1 2"/>
            <CustomParameter name="colorMat1" value="1 0.25 0 2"/>
            <CustomParameter name="colorMat2" value="0.5 0 0 2"/>
            <CustomParameter name="colorMat3" value="0.1 0.1 1 1"/>
            <CustomParameter name="colorMat4" value="1 1 0.1 1"/>
            <CustomParameter name="colorMat5" value="0.05 0.05 0.05 1"/>
            <CustomParameter name="colorMat6" value="1 0.1 1 1"/>
            <CustomParameter name="colorMat7" value="0.1 1 1 1"/>
            <CustomParameter name="lightControl" value="0 0 0 0"/>
            <CustomParameter name="blinkOffset" value="0 0 1 0"/>
        </Material>
    </Materials>
    <Shapes externalShapesFile="rearLights.i3d.shapes"/>
    <Dynamics/>
    <Scene>
        <Shape shapeId="1" name="backlightStatic" translation="6.66131e-16 0.920761 -5.43937" rotation="0 180 0" clipDistance="35" nodeId="82" materialIds="15" castsShadows="true" receiveShadows="true" decalLayer="1"/>
    </Scene>
</i3D>

As Dogface has pointed out there are further meshes applied to the lights each with its own shader setting

lightsGlassStatic --variation --reflector_colorMask
lights -- variation --colorMask
again using the detailArray dds

So colour is controlled by the shader in conjunction with the detail array difuse set in the bottom of the shader below the Attributes Custom Texture 0 --detailArray_specular, Custom Texture 1--detailArray_normal, Custom Texture 2-- detailArray_diffuse to be set as well, detailArray dds from the the data/shared folder.

Image showing detail array composition

Image
JDMFarms
Posts: 168
Joined: Sun May 08, 2016 8:58 pm

Re: Object missing required vertex for a material

Post by JDMFarms »

DogFace, a couple reasons why i chose to play/mod in FS19. thats for a different post if there is real interest in that question.

SuBBie, that is a very informative, bookmark worthy post for me. However, I think i see where the confusion came in. My shape is tied to the 'clearPlastic' material...true static, not an xml controlled shape. I think i confused this thread by trying to get the reflective shapes to work with the xml controls. This may help clarify what shape im working on. As DogFace said and I fully understand, there are three shapes for these lights (base, bulb, lense). those are my labels as a shade tree American mechanic to help me underrstand these shape's roles.

my plan for yesterday fell apart so starting again today. going to test a simple export/import/export of lightsGlassStatic to see if I made a rookie mistake during my 90 degree learning curve last week. if the test proves things work, then i'll go to the next level and start reshaping that shape to see if it comes out correct this time.

Image
Image
Image
Image
JDMFarms
Posts: 168
Joined: Sun May 08, 2016 8:58 pm

Re: Object missing required vertex for a material

Post by JDMFarms »

Ok, the simple export/import/export/import did prove im missing something in blender. Maybe there are some steps that are commonly known to do but not known to me.

Here are the steps i did for this simple test...
1) exported single shape (lightsGlassStatic) to .obj
2) imported .obj to blender
3) added vertextPaint layer and a few other i3d attributes
4) exported to i3d
5) added all support files/materials in notepad++
6) tested/inspected i3d
7) imported to the original light system i3d to compare both lightsGlassStatic shapes
8) found the new one does not have the red tent on the glass like the original one.
9) went back into blender, painted red on the vertpaint layer, exported again, found same outcome.

Image
User avatar
Dogface
Posts: 1062
Joined: Mon Nov 28, 2016 3:02 pm
Location: PC ⛽ USA

Re: Object missing required vertex for a material

Post by Dogface »

Do you have to use an old version of GE to edit FS19?
JDMFarms
Posts: 168
Joined: Sun May 08, 2016 8:58 pm

Re: Object missing required vertex for a material

Post by JDMFarms »

humm...i always thought the GE version was matched to the game version. from past experience, if you open a previous version i3d in a new version and save it, it will make it the new version.
TheSuBBie
Posts: 538
Joined: Wed Jun 10, 2020 11:38 am

Re: Object missing required vertex for a material

Post by TheSuBBie »

if you open a previous version i3d in a new version and save it, it will make it the new version
Not straight from the Farming Simulator game files as shaders have to be updated, easiest way is to Open the subject in previous version of GE as New Mod from Game save all with files and then open in later GE version, shaders etc will automatically be updated.
Or open in new version File -- Export All With Files open subsequent i3d in notepad and adjust shader and shared paths to
$data/shaders, $data/shared respectively.
Last edited by TheSuBBie on Wed Feb 08, 2023 4:17 pm, edited 1 time in total.
JDMFarms
Posts: 168
Joined: Sun May 08, 2016 8:58 pm

Re: Object missing required vertex for a material

Post by JDMFarms »

true, i learned that the hard way in FS17 when i brought in an FS13 tractor. textures were way off until i learned to updated the shaders.
User avatar
Dogface
Posts: 1062
Joined: Mon Nov 28, 2016 3:02 pm
Location: PC ⛽ USA

Re: Object missing required vertex for a material

Post by Dogface »

I am confused. You are modding the truck for FS19, not converting it to FS22. So why would you want FS22 shaders?

I have been trying to recreate the problem and getting stuck on all the different versions.
Post Reply