Comments (3)
This is a limitation of the library. Since we use simple string compare to determine if a keyword is used within a shader. If said keyword is used, it’s particular patch is injected
we make no distinction between assigning or accessing. We can’t without more complicated processing of the shader which would cause a performance hit
I’m working on a new version of the library where I may address it. But until then your best bet is to not use csm_FragColor but some other internal shader value
we are already tracking this issue on #48 so I will close this one. Feel free to leave more comments regardless
from three-customshadermaterial.
Ahh, that makes sense. Thanks for clarifying!
Now the shader works as expected, thank you very much!
from three-customshadermaterial.
By the way, If you are attenuating with distance it would make more sense to use a uniform:
uniform float uDistance;
void main() {
csm_DiffuseColor.a = clamp(MAX_DIST - uDistance, 0.0, 1.0);
}
from three-customshadermaterial.
Related Issues (20)
- If the base material has a map, a CSM from it throws an error on three >= 0.151.0 HOT 1
- Shader compilation failure if csm_Feature used is not compatible with base material HOT 2
- Warning: Function copy already exists on CSM, renaming to base_copy HOT 2
- Support macro defines like THREE.ShaderMaterial HOT 1
- Waves example seems to be broken HOT 3
- Extended meshBasicMaterial does not have access to cameraPosition uniform HOT 3
- Problem with using csm_PositionRaw and InstancedMesh HOT 9
- TresJs implementation HOT 2
- How to change the opacity of extended material ? HOT 3
- Couldn't extend `<MeshReflectorMaterial/>` from `drei` HOT 1
- Feature request addition of transmision and thickness maps HOT 1
- Cannot use both csm_DiffuseColor and csm_FragColor in if/else HOT 3
- Extending ShadowMaterial HOT 22
- Failed to resolve module specifier "crypto" HOT 2
- Textures HOT 3
- Broken examples HOT 3
- examples for mapping color attribute? (never been done…) HOT 1
- Losing reflectivity of Physical Material. HOT 1
- Losing Alphahash HOT 1
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 three-customshadermaterial.