nel_material - ryzom/ryzomcore GitHub Wiki


title: NeL Material description: published: true date: 2023-03-22T02:06:13.025Z tags: editor: markdown dateCreated: 2022-03-11T00:18:16.674Z

#!

[01:24] <Kaetemi> under node properties there's ac checkbox in animation "allow automatic animation"
[01:31] <Kaetemi> and you can use this to animate textures ;)
[01:32] <@anarkia> like waterfall etc with an animated uvwmap ?
[01:32] <Kaetemi> yep
[01:33] <Kaetemi> animate some texture, multiply with another texture, etc can make some interesting chains to get cool effects :p
[01:33] <osq> :)
[01:45] <Kaetemi> ah to get texture animation working you must enable "Export texture matrix"
[01:51] <Kaetemi> in the nel material
[01:52] <Kaetemi> so in node props, enable "export node animation", "export animated materials" and "allow automatic animation", in the nel material enable "export texture matrix", and create the animation curve on the bitmap node in the animation curve editor

#!

[00:43] <Kaetemi> http://dl.kaetemi.be/ryzom/detailex.7z example max file for using texture multiply with a repeat detail texture for boosting near texture detail
[00:45] <Kaetemi> can do with either using a separate uv channel or using a higher tiling rate on the texture setting
[00:48] <Kaetemi> http://dl.kaetemi.be/ryzom/detailex.png so that's one of the things you can pull off with the nel slots (just use the button setup 2 texture multiply :p )
[00:48] <Kaetemi> super high detail 64x64 tex :D

#!

[23:19] <Kaetemi> are you using a specular channel in your texture btw?
[23:19] <@anarkia> yes, in the alpha
[23:24] <Kaetemi> anarkia: the specular channel in the alpha is only valid when using the Specular shader
[23:25] <Kaetemi> and then you just put in the Specular texture one of spec_base.tga or spec_luxe.tga (they're under stuff\tryker\agents\_textures\actors)
[23:25] <Kaetemi> or one of the other spec textures
[23:26] <Kaetemi> or a cubemap..
[23:26] <Kaetemi> or make your own :p
[23:47] <@anarkia> but i wondered, what means the level of the spec in the nel mat?
[23:48] <@anarkia> cause normally a 4 won't do that on a standard mart
[23:48] <@anarkia> mat*
[23:48] <Kaetemi> that spec level has no influence on the spec map
[23:48] <Kaetemi> spec map is a separate thing
[23:48] <Kaetemi> the spec in the nel mat is for the spec that comes from lights
[23:48] <@anarkia> oh ok
[23:49] <Kaetemi> which is the ugly per vertex specular :)
[23:49] <@anarkia> so it has no other way than modifying the alpha channel of the texture?
[23:49] <Kaetemi> correct, for the reflection it only uses the alpha channel :)
[23:49] <@anarkia> i thought puting a grey scale spec could avoid to reopen/export the tga
[23:49] <Kaetemi> and it's literally added to the light output regardless of the lights in the scene
[23:50] <@anarkia> filthyyyy
[23:50] <Kaetemi> :)
[23:50] <Kaetemi> old school opengl :)
[23:50] <Kaetemi> in object viewer -> go window -> sun color
[23:50] <Kaetemi> to play with the lighting
[23:51] <Kaetemi> it's artistic effects, not pbr :D
[23:51] <Kaetemi> so basically every nel light has three channels
[23:51] <Kaetemi> diff, spec and ambient
[23:52] <Kaetemi> ambient is simply flat lighting color that is added everywhere, diffuse comes from the light direction, and spec is the light that comes from the light reflection direction
[23:53] <Kaetemi> so ex in fyros the ambient is set to a dark sand-like color (it changes during day/night cycle) to give it a warm atmosphere
[23:53] <@anarkia> where is it defined?
[23:53] <Kaetemi> continent sheets somewhere
[23:53] <@anarkia> okay, so modifying sun color in the viewer has no effect after exiting the viewer?
[23:54] <Kaetemi> viewer is just viewer, doesn't save anything :)
[23:54] <Kaetemi> it's preview tool
[23:54] <@anarkia> 'k
[23:54] <Kaetemi> L:\leveldesign\World\Lesfalaises(matis)\lesfailaises.continent
[23:54] <@anarkia> lol
[23:54] <@anarkia> les failaises
[23:54] <Kaetemi> for matis, it's gray ambient 100, diff spec 255
[23:54] <@anarkia> kind of fail name
[23:54] <Kaetemi> during daytime
[23:55] <Kaetemi> andduring night the ambient goes to a blue rgb 80,120,170 (which is a brighter ambient than during day)
[23:55] <osq> yes it's like foorge they is error in name sometime
[23:55] <Kaetemi> and the diffuse goes down to the same level
[23:55] <Kaetemi> and specular goes all the way down to 120,87,31 to have less of a sunny effect
[23:56] <@anarkia> classic color changes then ^^
[23:56] <Kaetemi> so the overall light levels tend to remain roughly the same but the balance is changed :)
[23:56] <Kaetemi> yea
[23:56] <Kaetemi> and the fancy specular effect is basically added on top :p
[23:59] <Kaetemi> the reflection can't really use any light source as light level in any case, the reflection itself is a light source :)
[23:59] <Kaetemi> you can put a cubemap in the reflection slot too
[00:00] <Kaetemi> and then swap it when the lights swap
[00:00] <@anarkia> real time trick
[00:04] <Kaetemi> but yeah, just use a nice artsy colored reflection map that matches your texture to make it look nicer than just the spec_base :) there's a whole lot of fancy spec textures in the database as example
[00:18] <Kaetemi> so yeah, by making a specular texture that's fuzzy you get a less glossy looking object, by making a specular texture with lot's of weird detail in you get a more glossy looking obj, trick is to use multisub then if you want different glossiness grade :p
[00:19] <Kaetemi> (which is kinda what you do with the gloss channel in pbr, which basically selects the cubemap depending on the gloss level, but manually here)

#!

[23:18] <Kaetemi> you can just go nel export > view the scene to preview in nel
[23:21] <Kaetemi> also yeah need to configure your texture lookup paths in object_viewer.cfg in the max dir :)

#!

[14:55] <Kaetemi> essentially what you do is, set shaders type to normal (simple multitexture)
[14:55] <Kaetemi> and use the setup stage with the setup simple multitexture material to automatically configure the nel slots
[14:56] <Kaetemi> the nel slots are simply bog standard opengl 1.x multitexture, so you should consult opengl for the details on the texture shaders
[14:56] <Kaetemi> but normally you should not need to worry about the nel slots and just use the automatic setup stage
[14:57] <Kaetemi> for alpha there are also three buttons 'setup blend' etcetera which automatically configure the alpha for you if you need it, but prefer alpha test rather than alpha blend where possible, blend is slower
[15:04] <Kaetemi> nel slots is basically the chain of operations to go from vertex lighted model to texture colored model, so a basic setup is simply "diffuse (light) * texture 0"
[15:04] <Kaetemi> it's useful if you want to do tricks like overlaying tiling fine detail maps over the rough color texture
[15:06] <Kaetemi> an example is this, compare regular direct3d render with the detail textures, the detail is simply a second single channel texture multiplied with the first on the rgb channel http://cloud.steampowered.com/ugc/559811256412904229/808A9C821F17C37743B4B75721149A384D91B092/
[15:10] <Kaetemi> this is the nel material reference suite from nevrax http://dl.kaetemi.be/ryzom/tools/nel_driver_test_suite.zip
[15:10] <Kaetemi> this is the mrm interfaces sample from nevrax dl.kaetemi.be/ryzom/tools/nel_mrm_interfaces_sample.zip
[15:14] <@Madi> re
[15:14] <@Madi> juste a question
[15:14] <@Madi> the new material version is compatible with the official ryzom client ?
[15:14] <Kaetemi> yes
[15:14] <Kaetemi> it's a gui change
[15:14] <Kaetemi> it was full of dead 3dsmax standard gui
[15:16] <Kaetemi> and do not use the old nevrax max files directly, they cause some memory bugs in 3ds max, need to use the converted ones
[15:17] <Kaetemi> http://dl.kaetemi.be/ryzom/assets/ryzom_assets_rev3.7z

#!

[03:08] <Kaetemi> anyways, the trick for good looking models in ryzom, just add some particles and make good use of reflection, especially the reflections
[03:09] <Kaetemi> a real nice reference for reflection is the heavy marauder armor, those are some real nice tricks to make it shiny
[03:09] <Kaetemi> avoid using the flat specular, it's ugly
[03:10] <Kaetemi> use the sexy cubemap reflections and a specular channel in the texture map
[03:10] <Kaetemi> and multiple materials to use different reflections for different reflection grades
[03:11] <Kaetemi> quick quick copy paste this all to the wiki :o)

The following is a document generated by GPT-4 from this chatlog, for review. {.is-danger}

NeL Material for Artists

This documentation is designed to help artists working with Ryzom Core and NeL to create visually appealing models and textures.

Texture Animation

  1. Enable "Export texture matrix" in the NeL material.
  2. Enable "Export node animation", "Export animated materials", and "Allow automatic animation" in node properties.
  3. Create the animation curve on the bitmap node in the animation curve editor.

Texture animation can be used to create effects like waterfalls by animating the UVW map.

Texture Detail Enhancement

You can use a separate UV channel or a higher tiling rate on the texture setting to enhance texture details. For example, you can use texture multiply with a repeat detail texture for boosting near texture detail.

Specular Channel and Reflections

The specular channel is stored in the alpha channel of a texture when using the Specular shader. To make good use of reflections, follow these tips:

  1. Use the Specular shader.
  2. Add a specular texture (spec_base.tga, spec_luxe.tga, or another custom specular texture) or a cubemap.
  3. Adjust the Specular level in the NeL material to control the specular effect from lights.

Keep in mind that the Specular level has no influence on the specular map, and the per-vertex specular effect from the lights is usually considered unappealing. Experiment with different levels of glossiness for your objects by using multisub materials with different glossiness grades.

NeL Material Slots

The NeL material slots are standard OpenGL 1.x multitexture operations. Typically, you shouldn't need to worry about the NeL slots and use the automatic setup stage instead. However, if you want to create specific effects, you can customize the NeL slots.

To configure a simple multitexture material:

  1. Set the shaders type to "Normal (simple multitexture)".
  2. Use the "Setup stage" with the "Setup simple multitexture material" option to automatically configure the NeL slots.

Alpha Configuration

For configuring alpha in NeL materials, use the 'Setup blend' option or the other alpha setup buttons. Prefer using alpha test rather than alpha blend when possible, as alpha blend tends to be slower.

Export and Preview

  1. Go to "NeL Export > View the Scene" to preview your model in NeL.
  2. Configure your texture lookup paths in object_viewer.cfg in the 3ds Max directory.

Tips for Good Looking Models

  1. Add particles for extra visual effects.
  2. Make good use of reflections:
  • Use cubemap reflections and a specular channel in the texture map.
  • Use multiple materials to have different reflections for different reflection grades.
  1. Avoid using flat specular effects, as they usually look unappealing.
⚠️ **GitHub.com Fallback** ⚠️