Modding, Mission Design, and Coding > Test Builds

Weapon impact decal test builds

(1/7) > >>

m!m:
Apparently there has been a decal implementation in FSO before but that got removed again for some reason. This new decal system should work better and more importantly should work for the foreseeable future. This new system is based on our deferred renderer infrastructure which makes it very easy to render decals onto arbitrary geometry. Here are the test builds: http://swc.fs2downloads.com/builds/test/decals/

Typically these decal system would also allow to change the normal data of the surface where the decal is created but due to the way the rendering engine of FSO works at the moment that is not possible to implement. Once this initial version is integrated into FSO I will take a look at how the engine can be changed in order to allow normal mapped decals to be implemented.

The integration of the decals into the engine is quite limited at the moment since I first wanted to actually have a working system before adding more elaborate features. The builds introduce a new decal table type. There is no main table so you have to use modular tables that are named <something>-dcl.tbm. At the start of the table you need a #Decals and terminate that with #End at the end of the file. After that you can add as many decals as you like with $Decal.

After $Decal you need to specify the name of the decal definition e.g. $Decal: TestDecal.

+Diffuse: This specifies the texture or animation that should be used as the color channel of the decal. Currently there is no other channel but more features will be added in the future.

+Loop: This lets you specify if the animation should reset once it reached its last frame or stay on that last frame.

The only option currently supported is +Diffuse which specifies what diffuse texture should be used for this decal. This may be an animation.

Here is a complete table that I used for testing:

--- Code: ---#Decals

$Decal: TestDecal
+Diffuse: ExpMissileHit1
+Loop: False

#End

--- End code ---

To use that decal as the impact decal of a weapon you need to add $Impact Decal after the location where the engine expects $Shots:. You specify both which decal you want to use and how big the decal should be in the game world like this:

--- Code: ---$Impact Decal: TestDecal
 +Radius: 20
 +Lifetime: (1.0 5.0)

--- End code ---

+Lifetime specifies for how long the decal should stay around after being created. You can specify the range of possible values by using two values. The lifetime of each individual decal will then the chosen within that range. You can also specify the string "Eternal" (I'm still searching for a better term here so let know if you know one) if the decal should never vanish. This should only be used for very important effects since every decal uses some performance so too many will cause FPS issues.

As soon as that weapon hits a ship (it only works for ships at the moment) it will spawn the decal. The decals do not expire at the moment so performance will probably suffer if too many decals are created.

Please let me know if you find any bugs and while you are here, please let me know how this system should be integrated into FSO.

Spoon:
I'd like to test, if you could add the soundsets to this build.
Because my sounds.tbl is already too far mutated now, to use build's that don't have it  :p

(so close to adding dlc to the game)

Colonol Dekker:
And one day......geomod.
#holygrail

m!m:

--- Quote from: Spoon on October 11, 2017, 10:17:08 am ---I'd like to test, if you could add the soundsets to this build.
Because my sounds.tbl is already too far mutated now, to use build's that don't have it  :p

--- End quote ---
Here are your special builds: https://www.mediafire.com/file/t3kw3w1c8i949x6/specialSpoonBuilds.7z

I changed the syntax of $Impact decal a bit so now it needs to look like this:

--- Code: ---$Impact Decal: TestDecal
+Radius: 20

--- End code ---


--- Quote from: Colonol Dekker on October 11, 2017, 10:36:45 am ---And one day......geomod.
#holygrail

--- End quote ---
Uhh, I'll let other people implement that because that's actually hard to do...  :warp:

Spoon:
Crashes a the start of a mission with normal build, with a debug its crashes when firing:


Navigation

[0] Message Index

[#] Next page

Go to full version