PBR llFunctions
tracked
Blau Rascon
I've spent about the last week updating some scripts to handle both PBR and Blinn-Phong updates simultaneously. The scripts work fine, but the current way you have to update PBR values - through llSetPrimitiveParams and the full list of values - is not ideal. In order to avoid overwriting your existing values with blank or incorrect data, you have to have a way to know and store your existing values, modify those values, and send the whole list back in.
Adding in some llFunctions for PBR values, so you don't have to modify the entire parameter array to change one value, would make scripting PBR modifications much more pleasant to work with.
If llFunctions are not feasible, a way to update individual values in the parameter arrays without data loss (e.g. being able to pass a blank string as a texture and have it skip the value instead of applying it) would be appreciated.
I've compiled a list below of how I would personally pop each value out into a Set function (they would have matching Get functions, a la llGetColor and llSetColor):
---
For PRIM_GLTF_BASE_COLOR:
llSetGLTFBaseTexture(string texture, vector repeats, vector offsets, float rotation_in_radians, integer face);
llSetGLTFBaseColor(vector color, integer face);
llSetGLTFBaseAlphaMode(integer gltf_alpha_mode, integer face);
llSetGLTFBaseAlpha(float alpha, integer face);
llSetGLTFBaseAlphaMask(float alpha_mask_cutoff, integer face);
llSetGLTFBaseDoubleSided(integer double_sided, integer face);
---
For PRIM_GLTF_NORMAL (this really only has one function):
llSetGLTFNormal(string texture, vector repeats, vector offsets, float rotation_in_radians, integer face);
---
For PRIM_GLTF_METALLIC_ROUGHNESS:
llSetGLTFMetalRoughTexture(string texture, vector repeats, vector offsets, float rotation_in_radians, integer face);
llSetGLTFMetallicFactor(float metallic_factor, integer face);
llSetGLTFRoughnessFactor(float roughness_factor, integer face);
---
For PRIM_GLTF_EMISSIVE:
llSetGLTFEmissiveTexture(string texture, vector repeats, vector offsets, float rotation_in_radians, integer face);
llSetGLTFEmissiveTint(float emissive_tint, integer face);
Log In
Medea Destiny
As Spidey Linden is merging in overlapping posts, note that this also heavily overlaps with https://feedback.secondlife.com/scripting-features/p/need-a-function-for-easy-pbr-alpha-switching which is currently the most voted on script feature request. This is the fourth most voted on feature request. Between the two it should be clear just how much demand there is for this.
Basically without these features, PBR is crippled. Many of the most popular items in SL use this functionality, and by not providing these scripting functions, LL are shooting themselves in the foot and making a PR disaster for themselves. Yet work on this seems to keep getting put back.
LL really needs to change their priorities here, because there is clearly an underestimation of how important it is. We at OpenCollar are having to tell all our design partners who produce some of the most popular content in SL that we cannot support PBR yet despite it being out for half a year, because LL hasn't provided a usable way to do so yet. We're having to tell our very sizable user base not to use PBR on their collars because it will break content if they do. Frankly it's getting embarrassing.
Spidey Linden
Merged in a post:
llSetLinkAlpha/llGetLinkAlpha don't work on GLTF materials and they should.
Darien Caldwell
These functions were made to provide a fast way to change the alpha state of a link/face, but with the addition of GLTF, they no longer work for this new material type.
Bloodsong Termagant
PLEASE DEAR LORD!
and i thought it was bad when i had to change a link alpha or glow parameter in blinn-phong!!!
SL Feedback
Merged in a post from Gwynevery Resident:
Title: llSetLinkAlpha & Color should work with GLTF("PBR")
Details: llSetLinkColor & lSetLinkAlpha should work with PBR materials too. Especially the alpha is used a lot to hide/ show links in an object or make things invisible "on demand" ^^
Right now there's just this quite heavy workaround example of doing this:
Gwynevery Resident
SL Feedback. Addendum:
Not a bug but a rather complicated way now to set color or alpha of a linkset with PBR materials. See example in https://wiki.secondlife.com/wiki/GLTF_Overrides
And even this has issues if someone gets the idea to mix legacy and PBR materials in links or even faces... That would need a lot of scripting.
I'm not sure if this is already planned/scheduled since these functions are already mentioned as a reference inside of this wiki article:
Vincent Nacon
It's not a bug, it's an old function intended for Blinn Phong material. It only apply to the Blinn Phong type, which is now the fallback in case someone doesn't have the PBR viewer. You need to use llSetLinkPrimitiveParamsFast() instead. There are new flags for PBR. In this case, you need to use the PRIM_GLTF_BASE_COLOR, along with its params.
Gwynevery Resident
Vincent Nacon: It's more a feature request than a bug, yes. But it's essential.
The way you described is just a workaround, like LL states in https://wiki.secondlife.com/wiki/GLTF_Overrides as well:
"See this example for a workaround. The SL team is open to feedback on LSL improvements for GLTF."
Darien Caldwell
Vincent Nacon Well I disagree. The whole point of the llGet/SetAlpha functions was to avoid needing to use cumbersome llGet/SetLinkPrimitiveParams calls. The fact these functions no longer function breaks numerous scripts should anyone upgrade an item to use PBR. There's no legitimate reason these functions should only work on Blinn Phong but not PBR.
Vincent Nacon
Darien Caldwell Oh believe me, I understand, but we already have this request here. https://feedback.secondlife.com/scripting-features/p/pbr-llfunctions
MaxNormandy Resident
I'd also like to add that respective flags/parameters for llSetLinkPrimitiveParamsFast would be good so we could also update links and faces through it without delays.
Blau Rascon
Can't edit the post now, but wanted to add something I overlooked originally:
Would also likely need a Link version of these (e.g. llSetLinkGLTFNormal) to handle linked child prims.
Alternatively, since the names are getting very wordy: Add a Link variable to the start of each function mentioned above, so they all function like Link versions (e.g. llSetGLTFNormal(
integer link
, string texture, vector repeats, vector offsets, float rotation_in_radians, integer face); )Spidey Linden
tracked
Issue tracked. We have no estimate when it may be implemented. Please see future updates here.