GithubHelp home page GithubHelp logo

Comments (5)

jcjohnson avatar jcjohnson commented on July 22, 2024 35

@jbohnslav Yes, after looking at the code again I figured it out.

For each face, the texture tensor contains a discretized set of samples (in barycentric coordinates) of linear combinations of the colors for each vertex; during rasterization these sampled colors are re-sampled to generate the actual colors of faces. The texture_size controls the number of color pre-samples per face.

More concretely, suppose texture_size = T. Then textures has shape (N, F, T, T, T, 3), with the following semantics (up to a possible permutation of vertices):

textures[n, f, T - 1, 0, 0] is the RGB color of vertex 0 for face f
textures[n, f, 0, T - 1, 0] is the RGB color of vertex 1 for face f
textures[n, f, 0, 0, T - 1] is the RGB color of vertex 2 for face f

Other elements of the textures matrix give linear combinations of the colors at vertices, so for example:

textures[n, f, 0, 0, 0] is 0
textures[n, f, T - 1, T - 1, T - 1] is the sum of the colors at the three vertices for f
textures[n, f, T / 3, T / 3, T / 3] is equal to color1 / 3 + color2 / 3 + color3 / 3 (with T % 3 == 0)
textures[n, f, T / 2, T / 2, 0] is equal to color1 / 2 + color2 / 2 (with T % 2 == 0)

from neural_renderer.

nkolot avatar nkolot commented on July 22, 2024

Hi Justin, my CUDA kernel is the same as the original CUDA code in the Chainer inplementation by the authors. I am not an expert in Computer Graphics and I don't to give you an incorrect answer, so I think it will be better to ask the original authors. Please let me know if you have any additional questions.

from neural_renderer.

jcjohnson avatar jcjohnson commented on July 22, 2024

Thanks! I'll ask over at the original repo.

from neural_renderer.

jbohnslav avatar jbohnslav commented on July 22, 2024

Did you ever figure this out? I looked on the issues page of the original implementation, and didn't find your question.

from neural_renderer.

jbohnslav avatar jbohnslav commented on July 22, 2024

Thanks so much!

from neural_renderer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.