-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use texture for TeapotGeometry #248
Comments
Hello, The cube appears textured as UV are defined when To have a teapot properly textured you should export a teapot model from your favorite 3D modeling software with UV defined and load it via our |
Thanks, I see. So how to create UV programmatically? And how to check if loaded model contains UV or not? |
In the example, rendering is done using the https://github.com/aerys/minko/blob/master/framework/asset/effect/BaseTemplate.effect#L29 So if your geometry does not provide the "uv" data property, then the You can learn more about effect pass inheritance here. You can learn more about data property bindings here.
Look at other *Geometry class implementations.
User the if (geom->hasVertexAttribute("uv"))
{
// geometry has UVs...
} |
Here we have example how to load textures
https://github.com/aerys/minko/blob/master/tutorial/15-loading-and-using-textures/src/main.cpp
but if we replace
geometry::CubeGeometry::create(sceneManager->assets()->context())
to
geometry::TeapotGeometry::create(sceneManager->assets()->context())
and a bit scale
cube->component<Transform>()->matrix(cube->component<Transform>()->matrix() * scale(vec3(.15f)));
it doesn't work. No texture. Why?
The text was updated successfully, but these errors were encountered: