caosdoar / fornos Goto Github PK
View Code? Open in Web Editor NEWGPU Texture Baking Tool
GPU Texture Baking Tool
Hello, maybe i'm confusing something, but i was reading Fornos code and i think i have found a little problem:
This line of code:
Line 165 in 75e8ec5
Here for example:
uint gid = gl_GlobalInvocationID.x + workOffset;
if (gid >= workCount) return;
Pix pix = pixels[gid];
But the size of pixels is less than workCount:
workCount = ((map->positions.size() + k_groupSize - 1) / k_groupSize) * k_groupSize;
sixeOfPixels = map->positions.size();
So if map->positions.size()
is not a multiple of k_groupSize
, then in some point there will be an index out of range because this: if (gid >= workCount) return;
will not be evaluated while gid >= sizeOfPixels
is true.
One idea would be to include vertex color to capture meshes with colors, Meshlab saves .obj files with colors.
There does exist a flavour of Wavefront's *.obj that facilitates Vertex Coloring.. I know of two applications that can export these namely "MeshLab" (free) and "MeshMixer" (also free from Autodesk).. The vertex colours is actually found just after each vertex definition as shown below..
(Piece of *.obj)
/////////////////////////////////////////////////////////////////////////////////////
OBJ File Generated by Meshlab
Object VERTEXPAINT_004_OBJ.obj
Vertices: 284
Faces: 281
mtllib ./VERTEXPAINT_004_OBJ.obj.mtl
vn 0.029683 0.730087 -0.682709
v 1220.094482 -572.500000 177.713943 0.984314 0.764706 1.000000
"3 vals for Vert and 3 vals for Col"
vn 0.000000 0.858139 -0.513418
v 1291.571533 -609.439636 -28.628490 0.921569 0.219608 1.000000
vn 0.303129 0.896367 -0.323480
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.