ker wrote:
ugh, I guess the probability of finding the stolen stuff again goes to zero?
I hope not too much was lost.
Pretty much. Besides my laptop and passport they only got my dirty socks, so that was satisfying
ker wrote:
David Williams wrote:
Expose density/material types
I've already seen this inside the voxel templates.
Yep, I actually added this a couple of weeks a go, but the rest was lost.
ker wrote:
The PositionMaterial(Normal) templates store a float for the material.
You said it's there so one could dump the std::vector<PositionMaterial> directly to a gl/dx buffer, but you also wrote that this won't be done anymore in the future.
So either PositionMaterial and the Extractors use the type, or a getMaterialID() function is needed that casts to uint*_t.
I think that the voxel's getMaterial() function should return MaterialType rather than returning an int. That said, I think that materials should always be integer values, where as densities could be integer or floating point. Unless you can think of a reason why non-integer materials woul be useful?
Regarding the PositionMaterial(Normal) classes, I'm currently thinking they might be removed and the surface extractors would declare their own formats as nested classes. So for example you could declare a vertex of format 'CubicSurfaceExtractor::VertexFormat'. The exact format would vary between surface extractors but templatised code would always access it in the same way. Does that make sense? But I'm not there yet.
ker wrote:
Also the default value of 0 won't work with custom types except if they have a constructor for a numeric type. maybe this could be a template parameter defaulting to 0?
(the last part I did by creating my own Material class, but I'm guessing many people use enums and might use enum classes in the future)
I'm not familiar with enum classes (is this C++11?) but I will keep this issue in mind.
ker wrote:
David Williams wrote:
Remove getThreshold():
so the Material<> template's getDensity() functions won't make any sense anymore... more like a isSolid() function?
obviously this will forbid using MaterialDensityPair inside CubicExtractor and Material inside MarchingCubesExtractor.
In the case of the CubicSurfaceExtractor I'm imagining that it will only use materials and will never look at densities. I think this is ok, as it can't do anything sensible with the densities anyway? The marching cubes extractor will always use densities, and will also use the SFINAE principle described above to use materials only if they exist. So I don't think we lose any functionality here.
Regarding some kind of 'isSolid()' function... this also need consideration with regards to transparency. My current felling is that isSolid() is not enough. I think the user needs a way to tell the CubicSurfaceExtractor whether a quad should be generated for any pair of material IDs. E.g. if you have transparent red next to transparent blue, you would probably (?) still want a quad between them. This information could be conveyed with a callback, a lookup table, or some other approach. I think that the marching cubes surface extractor probably won't support transparency but I'm not sure yet.