Comments (4)
The <Base />
layer is more of a <Color />
layer. It provides a nice solid color. This is useful to, for example, darken a given material. You could do:
<Base color="black" alpha={0.3} />
Or fi you want to give something a specific tint.
Maybe we should rename <Base />
to <Color />
from lamina.
<Base color="black" alpha={0.3} />
Maybe we should rename
<Base />
to<Color />
I REALLY like the concept of a Color and agree that Base would be one, but the concept of it being a "base" is important
Many layers (Noise, displacement, etc) require a base color to be set and it's often something people mess up and get confused/frustrated when the stack doesn't seem to be "working"
One method is to require that a ColorLayer
(or one that satisfies the requirement) be present somewhere in the stack, order being irrelevant.
<LayerMaterial>
<Nosie />
<Color value="red" mode="multiply" />
<Texture />
</LayerMaterial>
A 100% opaque Color will block the alpha values of subsequent color layers like Gradient
<LayerMaterial>
<Color value="red" />
<Texture />
<Gradient type=βcircularβ colors={[rgba(0,0,0,100), rgba(0,0,0,0)] />
</LayerMaterial>
So if one is present and not otherwise called, the base should be ignored
But I think the biggest things are
- if people forget to define it defauting to the most likely need keeps the stack safe:
<LayerMaterial>
<!-- baseline <Color value="black" /> -->
<Texture />
</LayerMaterial>
- Keeps things cleaner when doing simple colors:
const [baseColor, setBaseColor] = useState('#32A0CF');
<LayerMaterial color={baseColor}>
<Texture mode="screen" />
</LayerMaterial>
from lamina.
Yeah that sounds good to me. Having a color prop on the layer material itself could be the "base" color. And we could rename <Base />
to <Color />
Like this:
<LayerMaterial color="lightblue"> π Base color
<Noise mode="screen" />
<Color color="red" mode="multiply" /> π Give the noise red tint
</LayerMaterial>
from lamina.
Addressed in 1.1.0
from lamina.
Related Issues (20)
- Add all base material properties to debugger HOT 4
- Transmission property not working in vanilla version. HOT 1
- Setting Alpha in vanilla material doesn't work. HOT 10
- Unstable examples in codesandbox HOT 1
- Why does CustomLayer example change the position if the comment says it shouldn't be transformed? HOT 2
- Skinned Meshes stop working with Lamina HOT 4
- Add mask layers HOT 7
- Tree shaking of debug code? HOT 3
- Using with Sveltekit HOT 16
- flatShading prop has no effect on LayerMaterial
- Uncaught TypeError: type is not a function
- RFC: Change behavior of how vertex shader layers are modifying positions HOT 2
- LayerMaterial clone() method doesn't works HOT 1
- Transparent Fresnel HOT 1
- three-custom-shader-material 3.5.3 'csm_Normal' undeclared identifier HOT 1
- Blend two normal maps
- NextJS build fails due to import error related to react-merge-refs upgrade
- Texture layer does not support texture transform (.offset, .repeat, .center, .rotation) HOT 1
- Problems using the lamina noise functions in custom layer HOT 1
- how to make depth layer mapping = world work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lamina.