T3D 1.1 Final - Problems with fxFoliageReplicator - LOGGED (THREED-1971)
by Jeff Faust · in Torque 3D Professional · 06/06/2011 (9:45 am) · 10 replies
Build: T3D 1.1 Final Pro
Platform: Windows Vista
Target: normal game execution
Issues: Foliage generated by fxFoliageReplicator is failing to render for at least two reasons. I understand one reason but not the other.
Issue 1: Changes in object typing masks (made between Preview and Final) mess up a test in fxFoliageReplicator.cpp for disallowed placement surfaces. Here's the code:
The problem with this test is that Terrain is now considered both TerrainObjectType and StaticShapeObjectType. For foliage to show up on Terrain, both AllowOnTerrain and AllowStatics must be true, although this will have the undesired side-effect of allowing foliage on other StaticShapeObjects. A new test is needed here.
Issue 2: Assuming one works around the first issue, there is an additional problem whereby foliage will correctly be rendered when the Level Editor is open, but foliage disappears when the editor is closed. I have not been able to find the cause of this problem.
Platform: Windows Vista
Target: normal game execution
Issues: Foliage generated by fxFoliageReplicator is failing to render for at least two reasons. I understand one reason but not the other.
Issue 1: Changes in object typing masks (made between Preview and Final) mess up a test in fxFoliageReplicator.cpp for disallowed placement surfaces. Here's the code:
// Check Illegal Placements, fail if we hit a disallowed type. if (((CollisionType & TerrainObjectType) && !mFieldData.mAllowOnTerrain) || ((CollisionType & InteriorObjectType) && !mFieldData.mAllowOnInteriors) || ((CollisionType & StaticShapeObjectType ) && !mFieldData.mAllowStatics) || ((CollisionType & WaterObjectType) && !mFieldData.mAllowOnWater) ) continue;
The problem with this test is that Terrain is now considered both TerrainObjectType and StaticShapeObjectType. For foliage to show up on Terrain, both AllowOnTerrain and AllowStatics must be true, although this will have the undesired side-effect of allowing foliage on other StaticShapeObjects. A new test is needed here.
Issue 2: Assuming one works around the first issue, there is an additional problem whereby foliage will correctly be rendered when the Level Editor is open, but foliage disappears when the editor is closed. I have not been able to find the cause of this problem.
#2
06/14/2011 (12:55 pm)
@Jeff Faust: Could you please provide steps to reproduce the issue you are having with fxFoliageReplicator. I'm not having the same results.
#3
Issue 1 -- the object typing issue which affects population of the foliage?
OR
Issue 2 -- Foliage only rendering in editor?
06/14/2011 (1:16 pm)
Which of the issues are you not reproducing?Issue 1 -- the object typing issue which affects population of the foliage?
OR
Issue 2 -- Foliage only rendering in editor?
#4
1. Using T3D Toolbox, create a "New Project" based on Full template.
2. Use a text editor to add an fxFoliageReplicator to "Empty Terrain.mis".
Assets are already there so just add something like this:
3. Run the game with "Empty Terrain" mission.
The foliage should be clustered around the Player spawn point. For me, it's not seen. But if I F11 into the Editor, the foliage will now be rendered. F11 again to leave editor and the foliage disappears.
06/14/2011 (1:38 pm)
Assuming Issue 2:1. Using T3D Toolbox, create a "New Project" based on Full template.
2. Use a text editor to add an fxFoliageReplicator to "Empty Terrain.mis".
Assets are already there so just add something like this:
new fxFoliageReplicator(GrassyHillTop) {
position = "0 0 241.772";
rotation = "-0 -0 1 36.6693";
scale = "1 1 1";
UseDebugInfo = "0";
DebugBoxHeight = "1";
HideFoliage = "0";
ShowPlacementArea = "0";
PlacementAreaHeight = "2";
PlacementColour = "0.4 0 0.8 1";
seed = "1376312576";
FoliageFile = "art/shapes/groundCover/Grass.dds";
FoliageCount = "12333";
FoliageRetries = "100";
InnerRadiusX = "0";
InnerRadiusY = "0";
OuterRadiusX = "55";
OuterRadiusY = "55";
MinWidth = "1";
MaxWidth = "1";
MinHeight = "1";
MaxHeight = "1";
FixAspectRatio = "0";
FixSizeToMax = "0";
OffsetZ = "0";
RandomFlip = "1";
UseCulling = "0";
CullResolution = "20";
ViewDistance = "50";
ViewClosest = "1";
FadeInRegion = "50";
FadeOutRegion = "1";
AlphaCutoff = "0.2";
GroundAlpha = "0.2";
SwayOn = "1";
SwaySync = "0";
SwayMagSide = "0.1";
SwayMagFront = "0.2";
MinSwayTime = "3";
MaxSwayTime = "10";
LightOn = "1";
LightSync = "0";
MinLuminance = "0.7";
MaxLuminance = "1";
LightTime = "5";
AllowOnTerrain = "1";
AllowOnInteriors = "0";
AllowOnStatics = "1";
AllowOnWater = "0";
AllowWaterSurface = "0";
AllowedTerrainSlope = "45";
AmbientModulationBias = "0.0";
};3. Run the game with "Empty Terrain" mission.
The foliage should be clustered around the Player spawn point. For me, it's not seen. But if I F11 into the Editor, the foliage will now be rendered. F11 again to leave editor and the foliage disappears.
#5
06/14/2011 (4:58 pm)
@Jeff Faust: I see what you did there. It looks like the changes made to culling for 1.1 final has broken this feature. I tested it in 1.1 preview and it works just fine. Since it is a legacy feature I can't say for sure weather or not it will be fixed.
#6
I don't see anywhere in the release notes that FoliageReplicator is deprecated or anything. As you said, it was working in Preview.
06/14/2011 (6:16 pm)
What's a "legacy feature"? I know what it means, but is there a list of legacy features somewhere? I don't see anywhere in the release notes that FoliageReplicator is deprecated or anything. As you said, it was working in Preview.
#7
06/14/2011 (8:48 pm)
I believe it was solely intended as a sample of a custom object type and that either the Ground Cover or Forest features should replace its use?
#8
FxShapeReplicator and fxFoliageReplicator are commented out on line 32 to 34 in creator.ed.cs. fxFoliageReplicator was replaced with Ground Cover and Forest.
06/15/2011 (9:15 am)
A legacy feature is a term for an old software feature, while still functional, it may not work well as we progress through future updates.FxShapeReplicator and fxFoliageReplicator are commented out on line 32 to 34 in creator.ed.cs. fxFoliageReplicator was replaced with Ground Cover and Forest.
// Legacy features. Users should use Ground Cover and the Forest Editor.
//%this.registerMissionObject( "fxShapeReplicator", "Shape Replicator" );
//%this.registerMissionObject( "fxFoliageReplicator", "Foliage Replicator" );
#9
06/15/2011 (9:48 am)
I'm not sure that groundcover is a superior replacement to replicators in many cases, the control and fine resolution of replicators cannot easily be duplicated using groundcover.
#10
06/15/2011 (11:24 am)
If you tie a GroundCover to Terrain Material (Adding Foliage) you can get much tighter control and resolution (and not be limited to a certain radius).
Torque 3D Owner Christopher Tauscher
Default Studio