Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3]   Go Down

Author Topic: WIP CARSMASTER GRASS v.2.0  (Read 3232 times)

0 Members and 1 Guest are viewing this topic.

SpongeBob

  • member
  • Offline Offline
  • Posts: 232
Re: WIP CARSMASTER GRASS v.2.0
« Reply #24 on: March 08, 2024, 08:17:28 AM »

Very nice addition!

Really impresive. Keep on going!
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6031
Re: WIP CARSMASTER GRASS v.2.0
« Reply #25 on: March 10, 2024, 07:33:26 AM »

Don't overlook the illumination under a low Sun as well. The appearance when looking up-Sun and down-Sun is important.  ;)
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

carsmaster

  • Modder
  • member
  • Offline Offline
  • Posts: 731
Re: WIP CARSMASTER GRASS v.2.0
« Reply #26 on: March 11, 2024, 02:53:20 AM »

Don't overlook the illumination under a low Sun as well. The appearance when looking up-Sun and down-Sun is important.  ;)
Yes you are right. The lighting work in IL-2 is very outdated and imperfect. This is the main problem.
Logged

carsmaster

  • Modder
  • member
  • Offline Offline
  • Posts: 731
Re: WIP CARSMASTER GRASS v.2.0
« Reply #27 on: March 12, 2024, 05:03:14 AM »

It has been experimentally established that the low-poly 3D grass model used in this case can only look normal in the time period from 09-00 to 15-00, unfortunately. Due to certain lighting algorithms in the IL-2 game (which cannot yet be influenced), the appearance of the grass becomes poor before 09-00 and later than 15-00.
Logged

ssn637

  • member
  • Offline Offline
  • Posts: 176
  • Men mean more than guns in the rating of a ship
Re: WIP CARSMASTER GRASS v.2.0
« Reply #28 on: March 12, 2024, 07:00:15 AM »

That sounds like an insurmountable issue unless your definition of "poor" is a glitch most of us casual observers wouldn't even notice :)
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6031
Re: WIP CARSMASTER GRASS v.2.0
« Reply #29 on: March 13, 2024, 11:07:00 AM »

It has been experimentally established that the low-poly 3D grass model used in this case can only look normal in the time period from 09-00 to 15-00, unfortunately. Due to certain lighting algorithms in the IL-2 game (which cannot yet be influenced), the appearance of the grass becomes poor before 09-00 and later than 15-00.

For other grass objects I have done a combination of surface normals adjustment and .mat file parameters to obtain good lighting appearance at all times. I'm sure the same can be done here.

For the surface normals, orienting them perpendicular to the faces is not always the best approach. For these kinds of objects which are comprised of flat faces largely standing on edge, either perfectly perpendicularly or nearly so, orienting the normals mostly vertically works well.

Here are some of the vertices from one of my kunai grass objects. Every four vertices define the four corners of one side of the long strip that makes up one line of grass. Note that all vertices for all strips, no matter their X/Y orientation on the ground, have the normal's Z component oriented identically, mostly vertically at 0.9659... (75 degrees). The X and Y normal components are oriented as necessary based on the strip's orientation on the ground.

Code: [Select]
-1.95624925 5.3062855 -0.01723 0.2118742154 0.1486492944 0.9659258274
-1.85718625 5.336709 2.862366 0.2118742154 0.1486492944 0.9659258274
1.078633 -4.2226295 2.862363 0.2118742154 0.1486492944 0.9659258274
0.97957 -4.25305325 -0.017233 0.2118742154 0.1486492944 0.9659258274
-0.86293975 4.49055475 -0.01723 -0.1595489072 0.2037926448 0.9659258274
-0.7797975 4.552413 2.862366 -0.1595489072 0.2037926448 0.9659258274
5.18940175 -3.47059375 2.412363 -0.1595489072 0.2037926448 0.9659258274
5.10625925 -3.53245225 -0.017233 -0.1595489072 0.2037926448 0.9659258274
0.76139825 -7.075611 -0.01723 -0.2079095038 -0.1541458209 0.9659258274
0.6583055 -7.06507575 2.862366 -0.2079095038 -0.1541458209 0.9659258274
1.67486925 2.88311925 1.962363 -0.2079095038 -0.1541458209 0.9659258274
1.777962 2.8725845 -0.017233 -0.2079095038 -0.1541458209 0.9659258274
0.81812775 3.62229925 -0.01723 0.0948942922 -0.2407952848 0.9659258274
0.915924 3.58802125 2.862366 0.0948942922 -0.2407952848 0.9659258274
-2.3917655 -5.84909525 2.862363 0.0948942922 -0.2407952848 0.9659258274
-2.48956225 -5.814818 -0.017233 0.0948942922 -0.2407952848 0.9659258274
-1.67631575 3.7336305 -0.01723 0.1112559676 0.233686554 0.9659258274
-1.573256 3.74448425 2.412366 0.1112559676 0.233686554 0.9659258274
-0.5258785 -6.20051375 1.962363 0.1112559676 0.233686554 0.9659258274
-0.62893825 -6.2113685 -0.017233 0.1112559676 0.233686554 0.9659258274


Here are the .mat file contents for LOD0:

Code: [Select]
[ClassInfo]
  ClassName TMaterial
[General]
  tfDoubleSide 0
  tfShouldSort 0
  tfDropShadow 0
  tfGameTimer 1
[LightParams]
  Ambient 1.0
  Diffuse 0.5
  Specular 0.0
  SpecularPow 0
  Shine 0.0
[Layer0]
  TextureName grass_2048.tga
  PaletteName
  Frame 0.0
  VisibleDistanceNear 0.0
  VisibleDistanceFar 1500
  TextureCoordScale 0.0 0.0 1.0 1.0
  ColorScale 1.0 1.0 1.0 1.0
  AlphaTestVal 0.5
  tfWrapX 1
  tfWrapY 1
  tfMinLinear 1
  tfMagLinear 1
  tfMipMap 1  //0
  tfBlend 1
  tfBlendAdd 0
  tfTestA 1
  tfTestZ 1
  tfUpDateClear 0
  tfModulate 1
  tfNoTexture 0
  tfAnimatePalette 0
  tfAnimateSkippedFrames 0
  tfNoWriteZ 0
  tfDepthOffset 0
  tfTranspBorder 0
  tfTestZEqual 0

//AlphaTestVal 0.5 has some edge
//transparency issue against sky;
//0.7 does not.
//But 0.5 here merges perfectly with
//Mid.mat, and looks more natural
//against ground.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

carsmaster

  • Modder
  • member
  • Offline Offline
  • Posts: 731
Re: WIP CARSMASTER GRASS v.2.0
« Reply #30 on: March 13, 2024, 11:15:21 AM »

For other grass objects I have done a combination of surface normals adjustment and .mat file parameters to obtain good lighting appearance at all times. I'm sure the same can be done here.......
Thanks for reminding me about this trick with normals. I guess I'm getting old and I'm already forgetting a lot.
Logged

carsmaster

  • Modder
  • member
  • Offline Offline
  • Posts: 731
Re: WIP CARSMASTER GRASS v.2.0
« Reply #31 on: March 13, 2024, 11:58:11 AM »

I remembered that I experimented in 3D max with rotating the normals, but unfortunately, after exporting the finished mesh to the game, for some reason the normals did not become the way I needed. I have not yet used your method to manually edit normals through data tables.
Logged

carsmaster

  • Modder
  • member
  • Offline Offline
  • Posts: 731
Re: WIP CARSMASTER GRASS v.2.0
« Reply #32 on: March 14, 2024, 06:47:31 AM »

Alas, the method of manually editing normals through data tables does not bring the expected results, there are probably too many polygons to find the “golden mean”.
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6031
Re: WIP CARSMASTER GRASS v.2.0
« Reply #33 on: March 14, 2024, 09:34:17 AM »

Whether it's one polygon or a thousand, the process is the same. Once you've set all Z components of the normals to a fixed angle, whatever are the values for the X and Y components, each is altered  by a simple multiplication of a sin or cos value. I forget the specifics as I tap this out on my phone. Every vertex's normal is treated individually; there is no consideration of a 'mean'. The process is simply rotating the normal upward through an arc until its zenith angle reaches the desired value.

What I do is sketch out the scenario on paper, visualize the three rotational components,, then write the formulae for the X and Y components for one vertex, then drag the two formulae down the columns for the whole list of vertices in a couple of seconds. I don't learn as well by rote memorization, and so count on a basic understanding to work out the math from first principles.  ;)
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

carsmaster

  • Modder
  • member
  • Offline Offline
  • Posts: 731
Re: WIP CARSMASTER GRASS v.2.0
« Reply #34 on: March 14, 2024, 10:27:25 AM »

Whether it's one polygon or a thousand, the process is the same....
Thanks for the answer, but you misunderstood me. There are too many adjacent polygons, they influence each other with their lighting (I set the Ambient parameter to 2.0, otherwise everything is completely bad). And I unfold the normals themselves in the table as I want. Only this has virtually no effect on the poor display early in the morning and late in the evening.



Logged
Pages: 1 2 [3]   Go Up
 

Page created in 0.046 seconds with 27 queries.