Repository navigation
Conversation
VfxFile reads a vfx/*.xml effect into its emitters, behaviour chains, render stacks and references. VfxCurve parses the curve properties: channels, keys and the min/max mappings. VfxCurveTests and VfxFileTests cover both; VfxTestFiles builds small vfx files and packs for them.
Simulates an effect from its vfx file and draws its particles: continuous_mesh and continuous_rigid emitters, flipbooks, trails, vector fields, soft edges, heat haze, and smoke lit by the scene's sun and by light particles. The particle shader is Shaders/Particle.fx. Changes outside GameWorld.Core/Vfx: - RenderEngineComponent draws the scene's depth first when there are particles (soft particles fade against it), draws the new Transparent bucket after the solid scene in both passes, passes the light particles to the scene as PointLights, adds the glow as light whatever its alpha, and saves screenshots as straight-alpha PNGs. - SaveRenderImageSettings takes an optional DrawOverlays (default true). False also leaves out the labels, axis widget, FPS text, wireframe and selected faces. DrawLines is unchanged, and so is PhotoStudio. - RenderBuckedId gains Transparent and RenderingTechnique gains Depth. CommonShaderParameters gains ModelColour, PointLights and SceneDepth. - The MetalRough and SpecGloss shaders and materials take the point lights and the depth technique. ResourceLibrary loads the Particle effect. Tests cover the simulator, the renderer, the effect resolver and the screenshot PNG. The ones that need the game's files are [Explicit] and read WH3_DATA.
An EFFECT tag now draws its particles, simulated from vfx/<name>.xml on the tag's bone, with the tag's start and end time, scale, orientation and position. Persistent effects keep running across the animation's loops. - Show VFX checkbox; unticked, no effect file is read and only the locators draw. - VFX filter: a tag's id is the vfx_filter_id of the battle entities it plays on, so a unit and its Regiment of Renown that share one meta each get their own effects. - The scene rebuilds when a vfx file, texture, model or animation a particle uses changes in a loaded pack. - A rebuild keeps what an unchanged tag built, so dragging a number in the meta panel no longer rebuilds every effect.
An editor for vfx/*.xml, opened from the pack explorer or from Tools > VFX Editor. Edits are splices into the file's own text, so bytes nobody edited never change; an unedited file saves identical in the encoding it was read in. - Tree of the effect, its emitters, behaviour chains, render stacks and references; values as checkboxes, dropdowns of the words vanilla uses, or text. - Quality tiers: an edit is linked across the tiers that matched, or applies to the shown tier only. - Add and remove properties, modifiers, emitters and references; duplicate, rename and retype emitters; copy and remove curve channels, with a graph. - Undo and redo of the last 100 edits. - Live preview using the particle renderer: projectile mode, a model as a guide, the Kitbash editor's lighting window, and a screenshot. Wiring: the Vfx_Editor entry in EditorEnums, Test.VfxEditor in Shared.Core's InternalsVisibleTo, the project in the solution and DI, and a theme rule so a ComboBox or TextBox in a ToolBar takes the app's style.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
hey, this adds an editor for
vfx/*.xmleffect files, and SuperView now actually draws the particles for EFFECT tags instead of just the locators. both run on one new particle simulator + rendererwhat it does
SuperView: an EFFECT tag draws its particles on the tag's bone, using the tag's start/end time, scale, orientation and position. there's a Show VFX checkbox to turn them off, and a VFX filter for which battle entity's tags play. a tag's id is the
vfx_filter_idof the entities it plays on, so a unit and its Regiment of Renown sharing one meta don't both draw anymore. the scene also rebuilds when a vfx file, texture, model or animation a particle uses changes in a loaded packVFX editor: opens
vfx/*.xmlfrom the pack explorer (asks if you want this or the text editor) or from Tools > VFX Editor. edits get spliced into the file's own text, so a file you didn't touch saves byte for byte in whatever encoding it came in. you get quality tiers, curves with a graph, add/remove for properties, modifiers, emitters and references, undo/redo (last 100 edits), and a live preview with a projectile mode, a guide model, the Kitbash lighting window and screenshotssize
89 files, +12,785 -39, roughly 5,900 of those lines are tests. four commits, each builds and passes on its own:
Shared.GameFormats, 2 new files)GameWorld.Core/Vfx,Particle.fx, the engine bits below, tests)Editors/VfxEditorproject + wiring)shared code it touches
the contributor guide asks for care in a few of these spots, so here's all of it:
Shared.GameFormats: just two new files inShared/GameFiles/Vfx/(VfxFile.cs,VfxCurve.cs), no existing file editedRenderEngineComponent.cs(+102 -15). particles are aRenderItem(ParticleRenderItem) in a newTransparentbucket, and the engine edits are only the whole-frame stuff:Transparentbucket after the solid scene, in both passesPointLightsso they light the solid scene tooSavePng) so additive light doesn't get lostSaveRenderImageSettingsgets an optionalDrawOverlays(defaults totrue).falsealso drops labels, the axis widget, FPS/stats text, wireframe and selected faces, which is what the VFX editor's screenshot uses.DrawLinesstill means the same thing and PhotoStudio isn't touchedRenderBuckedId.Transparent,RenderingTechnique.Depth, plusModelColour,PointLightsandSceneDepthonCommonShaderParameters. MetalRough and SpecGloss shaders/materials read the point lights and have a depth technique.ResourceLibraryloadsParticle.fxShared.Core: two one-liners, no logic:Vfx_EditorinEditorEnumsandTest.VfxEditorinInternalsVisibleToComboBoxorTextBoxinside aToolBarnow picks up the app's style (2 lines inControls.xaml)testing
pr-test.ymlruns on a fresh clone: restore, buildAssetEditor.csproj,dotnet test AssetEditor.sln --configuration Release. 1,390 passed, 0 failed, 6 skipped (the skipped ones are inShared.CoreTest, not mine)SkeletonAnimationLookUpHelperKarlPackTests(10 s wait) andExecute_CopiesNodePathToClipboard(system clipboard)Test.VfxEditor, 342 inGameWorld.CoreTest, 26 inTest.AnimationMeta[Explicit]tests against the game'svfx_desc.pack(setWH3_DATA): all 8,308 vanilla files round-trip and read the same as an XML parser reads them (328,060 curves, 0 problems), and the vocabulary scan reads 7,470 effectslimits
left out on purpose
SuperView's own Lighting... and Screenshot buttons, and the sun marker on the viewport gizmo. those are general viewport features, happy to send them as separate PRs