Crystal Hammer wrote: ↑Sat Nov 05, 2022 12:03 am
- So it means having one shader with 8 max layers would be quite wasteful if only 3-4 are used. Even more with triplanar.
But we have in shiny many shaders made from one, depending on options. E.g. I can set which layers (2 max) have triplanar and only these will sample 3x more, rest just once, w/o triplanar. Shiny has #if and would not add samplers or code blocks etc.
Is this way also possible in HLMS? Would be also useful to have e.g. 4 shaders, each for 1, 2, 3, or 4 used layers.
Yes it's possible. Hlms has @property your code @end
akin to #if #endif
But it depends on what you want do and how. Do you want to have to portions of the terrain with different settings? That'd be hard, because that needs two different shaders and that means they can't be merged into one single drawcall, something Terra assumes and does aggressively.
- Is material.json more feature rich? Or is everything from material.json also available in .material scripts?
- Can I (and how) set texture mode to warp in .material?
JSON has all settings, while .material scripts may not have all of them.
HlmsTerraDatablock parses the string looking for most options.
Manipulating texture modes is notably absent from .material
scripts.
- How can I inherit materials in material.json?
There isn't one. It's regular JSON so there is no way to inherit. JSON are more suited for being edited by tools and then use HlmsManager::saveMaterials
, rather than edited by hand.
On Colibri I implemented "copy_from".
I guess the same can be done using HlmsDatablock::clone
or HlmsDatablock::cloneImpl
- Can I toggle wireframe rendering for everything on scene easily, or do I need to iterate through all datablocks or something?
I'm afraid you have to iterated through all datablocks and set their HlmsMacroblock::mPolygonMode
.
- How can I set some LOD bias factor globally (as user option), e.g. to allow more quality for further distance (more than is in .mesh files).
See Camera::setLodBias
- How do I add tangents in Mesh (the new v2) created in code?
As you found out, converting it to v1, adding tangents then back to v2 is the only solution so far.
Wish I knew earlier, I wouldn't convert my code to v2 then I'd save time doing 1 import back.
v2 does have performance improvements over v1, so it wasn't for nothing
But honestly, feels like flying from Paris to Rome through Sydney.
Agreed, but since no one seems to need high performance tangent generation, no one has bothered to create one and the v2 -> v1 -> v2 is 'just fine' for most people.
I did write a very crude tangent generator that is designed to work with v2 streams, but it doesn't cover all edge cases like v1 does.
- What does this mean in Ogre.log?
Code: Select all
23:12:20: WARNING: Mesh2 instance 'rd.mesh.101_0' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
Is it bad? Will it be gone forever on device reset or something? How to fix it?
Yeah, it's about device reset.
If you created it via MeshManager::createByImportingV1, that warning should not appear, as MeshManager::loadResource
will take care of reloading it.
It basically calls createManual( ..., this ) where this is a ManualResourceLoader that gets called whenever the mesh needs to be reloaded.
- Is it easy to add height fog to Atmosphere? Can I just override something and add one shader part, or would I need to copy whole Atmosphere code and extend?
The Hlms shader code is in Samples/Media/Hlms/Pbs/Any/Atmosphere
and the one for drawing the sky is in Samples/Media/2.0/scripts/materials/Common/Any/AtmosphereNprSky_ps.any
(and relevant AtmosphereNprSky_ps.glsl, *.hlsl, etc for language-specific code)
Changing both should do what you need. I may be interested in such changes btw.