Skip to content

Commit

Permalink
ed ror gui upd
Browse files Browse the repository at this point in the history
  • Loading branch information
cryham committed Feb 27, 2024
1 parent 388e079 commit e3bb071
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
10 changes: 5 additions & 5 deletions docs/Developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ Also a HLMS PBS listener, it's that default `hlmsPbs->setListener( mHlmsPbsTerra
from Terra, this is only for Pbs objects, `hlmsTerra` has no listener (_ToDo:_ adding globalTime to both would need it).
Done so objects also receive terrain shadows. Only one listener can be used.

And we have own datablocks: `HlmsPbsDbCar` and `HlmsPbsDbWater` with more stuff when needed for paint or fluids.
And we have own datablock: `HlmsPbsDb2` with more stuff when needed for paint or fluids.

### Adding more uniforms

Expand Down Expand Up @@ -426,14 +426,14 @@ _ToDo:_ ? Add renderable->hasCustomParameter( 999.. ) for all to get info in deb

### Own DataBlocks

Inside `HlmsPbs2::createDatablockImpl(` we create `HlmsPbsDbCar` for vehicle paint params.
It has own `HlmsPbsDbCar::uploadToConstBuffer`, which is where data is uploaded from C++ to GPU material shader buffers.
Inside `HlmsPbs2::createDatablockImpl(` we create `HlmsPbsDb2` for vehicle paint params.
It has own `HlmsPbsDb2::uploadToConstBuffer`, which is where data is uploaded from C++ to GPU material shader buffers.

Currently can't change total size, must set `mUserValue[` in cpp and get in shader `material.userValue[`.
_ToDo:_ `body_paint` property not used yet.
**_ToDo:_** clone on our `HlmsPbsDbCar` fails? Same vehicles can't have different paints.
**_ToDo:_** `HlmsPbsDb2` clone fails?

When setting car material need to use `HlmsPbsDbCar*`. Set by `CarModel::SetPaint()`.
When setting car material need to use `HlmsPbsDb2*`. Set by `CarModel::SetPaint()`.
Changes need `scheduleConstBufferUpdate()` to apply.


Expand Down
1 change: 1 addition & 0 deletions src/editor/ExportRoR_Road.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ void ExportRoR::ExportRoad()
ofstream trd;
trd.open(roadFile.c_str(), std::ios_base::out);

trd << "rot_yxz\n";
trd << "// position x,y,z rotation rx,ry,rz, width, border width, border height, type\n";
bool begin = 0; int iroads = 0;

Expand Down
4 changes: 2 additions & 2 deletions src/editor/Gui_Init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,8 @@ void CGui::InitGui()
sv->Init("RoR_Water", &ror.water, -2,1); sv->DefaultI(0);
sv= &svRoR_WaterOfs; sv->Init("RoR_WaterOfs", &ror.yWaterOfs, -40.f,40.f, 1.f, 2,4); sv->DefaultF(-0.8f);

sv= &svRoR_Trees; sv->Init("RoR_Trees", &ror.treesMul, 0.f, 6.f, 2.f, 2,4); sv->DefaultF(1.f);
sv= &svRoR_Grass; sv->Init("RoR_Grass", &ror.grassMul, 0.f,12.f, 1.f, 2,4); sv->DefaultF(4.f);
sv= &svRoR_Trees; sv->Init("RoR_Trees", &ror.treesMul, 0.f, 4.f, 2.f, 2,4); sv->DefaultF(1.f);
sv= &svRoR_Grass; sv->Init("RoR_Grass", &ror.grassMul, 0.f, 8.f, 1.f, 2,4); sv->DefaultF(4.f);

sv= &svRoR_TileMul; sv->Init("RoR_TileMul", &ror.tileMul, 0.f, 10.f, 2.f, 2,4); sv->DefaultF(0.9f);
sv= &svRoR_ObjOfsY; sv->Init("RoR_ObjOfsY", &ror.yObjOfs, -2.f, 2.f, 1.f, 2,4); sv->DefaultF(0.f);
Expand Down
10 changes: 6 additions & 4 deletions src/editor/Gui_Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,15 @@ void CGui::SetGuiFromXmls()
svRoR_Water.Upd(); svRoR_WaterOfs.Upd();
svRoR_Trees.Upd(); svRoR_Grass.Upd();

svRoR_TileMul.Upd(); svRoR_ObjOfsY.Upd();

svRoR_RoadLay.Upd(); slRoR_RoadLay(0);
ckRoR_RoadCols.Upd();

svRoR_RoadStep.Upd(); svRoR_WallX.Upd();
svRoR_RoadHadd.Upd(); svRoR_WallY.Upd();
svRoR_TileMul.Upd(); svRoR_ObjOfsY.Upd();
svRoR_RoadStep.Upd(); svRoR_RoadAngle.Upd();
svRoR_RoadHadd.Upd(); svRoR_WallX.Upd(); svRoR_WallY.Upd();

svRoR_RoadVegetDist.Upd();

bGI = true;
}
Expand Down

0 comments on commit e3bb071

Please sign in to comment.