Comments (9)
Which reminds me of #310 Consider renaming maps to textures which would cause
uBaseColorMap
uBaseColorMapTexCoordTransform
uBaseColorTexture
uBaseColorTextureTransform //yay!
from pex-renderer.
So new components will look like that:
// basic
const material = {
baseColorTexture: texture
};
// or with transform
const material = {
baseColorTexture: {
texture,
transform: textureTransform
}
};
Fine by me. Renaming in pex-shaders is needed as well yes, so that's a big breaking change where we need to be careful with VSCode search & replace.
from pex-renderer.
Well it's actually not that simple as transform
in KHR_texture_transform is an object with offset, rotation and scale and not a matrix so it could be confusing.
So it would have to baseColorTexture.transformMatrix
(still shorter) and uBaseColorTextureTransformMatrix
from pex-renderer.
At the moment, materials texture.texCoordTransformMatrix
is not set directly. Instead, the more user friendly texture.offset/rotation/scale is used and the matrix only computed on set(). So you can either provide:
{ texture, offset?, rotation?, scale? }
{ texture, texCoordTransformMatrix }
The three questions:
- is renaming texCoordTransformMatrix to transformMatrix okay
- can we still allow texture.offset/rotation/scale and compute texture.transformMatrix in material system (render-pipeline?)
- can we animate update these properties at runtime, if so, how do you tell
texture.transformMatrix
to be recomputed?
from pex-renderer.
Instead, the more user friendly texture.offset/rotation/scale is used
Is it? :D I thought all we have is texCoordTransformMatrix
is renaming texCoordTransformMatrix to transformMatrix okay
Yes
can we still allow texture.offset/rotation/scale and compute texture.transformMatrix in material system (render-pipeline?)
How to name and pack given uniforms is up to renderer. Are there any other use cases for Material System? As of now the most appropriate place is standard material.
can we animate update these properties at runtime, if so, how do you tell texture.transformMatrix to be recomputed?
Are we thinking arcade game scrolling textures here? :)
from pex-renderer.
Instead, the more user friendly texture.offset/rotation/scale is used
Is it? :D I thought all we have is texCoordTransformMatrix
Yep, here we compute the matrix:
Lines 122 to 134 in 5cced07
can we still allow texture.offset/rotation/scale and compute texture.transformMatrix in material system (render-pipeline?)
How to name and pack given uniforms is up to renderer. Are there any other use cases for Material System? As of now the most appropriate place is standard material.
No but maybe in a shared space if basic renderer or any other wants to use textures and texture transform?
can we animate update these properties at runtime, if so, how do you tell texture.transformMatrix to be recomputed?
Are we thinking arcade game scrolling textures here? :)
Thinking texture spritesheet or something ;)
from pex-renderer.
Oh that's leftover code that has not been ported yet. The thing with material system is that renderers are building materials atm. And texture matrix update system would have to know all possible texture names or sniff for objects with texture property in material components, not optimal.
My plan for standard material was to support all possible 2d/3d mesh like scenarios that would involve textures and where texture transforms make sense. Other renderers like particles/lines/trails would less. Although i see usecase for spritesheets in those. Will it be full matrix with translate rotate scale though? Or rather offset, size as vec4? Just don't want to force generalization that is not there.
from pex-renderer.
Update.
Given that we udate uBaseColorMap
to uBaseColorTexture
we would end up with uBaseColorTextureTexCoordTransform
so maybe we should rename this too to uBaseColorTextureTransformMatrix
and following material prop:
const material = {
baseColorMap: {
texture: texture,
transformMatrix: mat3
}
}
from pex-renderer.
Suggested naming:
const material = {
baseColorTexture: {
texture: texture,
matrix: mat3,
texCoord: int,
}
}
uniform mat3 uBaseColorTextureMatrix;
Flags:
USE_BASE_COLOR_TEXTURE
USE_BASE_COLOR_TEXTURE_MATRIX
BASE_COLOR_TEXTURE_TEX_COORD
from pex-renderer.
Related Issues (20)
- material.id is missing and leads to cache issues HOT 4
- Improve reflection probes seams HOT 3
- Move shaders back to pex-shaders
- MSAA Antialiasing
- Layer system
- Reflection map prefiltering improvements HOT 5
- Provide default values when creating light components HOT 1
- Add support for attribute.dirty HOT 2
- Allow shadow map size customisation HOT 1
- Prevent camera helper rendering when rendering from the same entity camera component
- Renderer crashes on directional lights that don't cast shadows HOT 1
- Something is broken
- Directional light entity helper should not grow with light intensity HOT 9
- Maximum call stack size exceeded HOT 3
- Add basic render engine example
- Default skybox sunPosition HOT 1
- PostProcessing cleanup HOT 1
- Add custom attributeMap
- Camera clear color should be in linear space HOT 1
- [v4] material receiveShadows is not used
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 pex-renderer.