About Store Forum Documentation Contact



Post Reply 
Detail Power change for certain objects.
Author Message
Pherael Offline
Member

Post: #1
Detail Power change for certain objects.
Hi, is it possibile to change Detail Power for single object? I using ShaderParamChange for alpha in few cases (vanishing walls), but I want something similar for Details Power. I using detail color for adding dirt on objects but it should change depending of object dirtness value.

Edit: Also I noticed detail always disappear with LOD, could this be turn off?
(This post was last modified: 03-26-2019 11:26 AM by Pherael.)
03-26-2019 10:57 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Detail Power change for certain objects.
Hi,

I think you could define a global ShaderParam, and manually set it up to point to the Material Detail parameter.
ShaderParam MatDetail;

SetShaderParamChanges
https://github.com/Esenthel/EsenthelEngi...ng.cpp#L73
only calls change.param->setSafe(change.value);

https://github.com/Esenthel/EsenthelEngi...r.cpp#L704
which uses setChanged (_changed), _gpu_data_size and _data, so you'd have to setup only those members.


ShaderParam *src=Sh.h_Material (private API) or for simplicity public API Renderer.material_color, which both are actually the same.

MatDetail._changed=src->_changed;
MatDetail._gpu_data_size=SIZE(Flt); // just 1 float for detail
MatDetail._data=src->_data + ; // here calculate the offset for detail from the start of the MaterialParams class

then use MatDetail in ShaderParamChange

disabling detail based on LOD is done here:
https://github.com/Esenthel/EsenthelEngi...t.cpp#L147
I can try make a quick patch for controlling this part.
03-28-2019 06:56 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: Detail Power change for certain objects.
03-28-2019 07:06 AM
Find all posts by this user Quote this message in a reply
Pherael Offline
Member

Post: #4
RE: Detail Power change for certain objects.
Thank you for your support. I will try your solution.
03-28-2019 10:38 AM
Find all posts by this user Quote this message in a reply
Post Reply