-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Colouring support #291
Comments
Thank you for opening this issue, @therealprof! Support for colors is definitely a welcome feature. I've left thoughts in my comments below.
I don't really have an opinion here. I don't foresee any problems of using floating point numbers for colors, but
I don't think vertices are the right place to track information about color (or more generally, material). It's where the color ends up on the graphics side, but I don't think it makes sense to store color on vertices in the kernel, nor does it make sense on the model side to specify color per-vertex. Eventually, we might want to have a concept of solids, and track material information there. But for now, I think On the model side, users could specify an optional color for
I suppose that the same type would be used in the |
Hi, thanks for the comments, I'll check the remainder when I find some time; this one stuck out though:
The problems with floats is the same as floats anywhere else: Hashing, Ordering, Equality becomes a major pain and in case of Colour I don't see the benefit of this self-inflicted pain when we can simply convert the Colour to float before handing it off to the rendering. Of course that doesn't mean that we can't extend this later on to support fancier mechanisms but I wouldn't like to make things hard from the beginning without any real benefit. |
Well, hashing/ordering/equality is taken care of by But those arguments just support my position of having no clear preference. I'm still totally fine with |
If you want to have Shapes with Colours/Material they probably will have to be hashable and orderable since those are likely to end up in data structures which enforce that requirement. |
As I said, |
Yes, but |
I'm open to that, but I haven't thought a lot about that, and am not clear on what the consequences would be. But yeah, that is a different discussion 😄 |
So I was looking into this. The rendering side of things looks somewhat straight forward but I've not a clue on how to add support on the modelling side and carry that over to the kernel. |
#338 moves the color definition of the vertices one level closer to the actual model. Once we have the ability to specify plain colors we could bump it up a notch and turn this a proper material definition and add more features. I noticed that the models render much nicer with a slight amount of transparency added but I'm on the fence on whether it is worth it to make this as a hack to the renderer to allow for toggling it on or off or whether we simply "wait" until the models gain the ability to specify the color (and transparency). |
The examples have been extended to demonstrate the coloring of objects. A few bits and pieces are probably still missing or could be improved but let's look at those in another step. Closes hannobraun#291 Signed-off-by: Daniel Egger <[email protected]>
The examples have been extended to demonstrate the coloring of objects. A few bits and pieces are probably still missing or could be improved but let's look at those in another step. Closes hannobraun#291 Signed-off-by: Daniel Egger <[email protected]>
The examples have been extended to demonstrate the coloring of objects. A few bits and pieces are probably still missing or could be improved but let's look at those in another step. Closes hannobraun#291 Signed-off-by: Daniel Egger <[email protected]>
It would be great if Fornjot would have support for specifying custom colors per object in the rendering rather than the default of red with full opacity. This might also be useful to figure out which specific item is causing rendering issues.
There's a number of issues to sort out though:
[f32;4]
everywhere since it doubles up the issues FJ already has with the floating point representation of coordinates and would propose [u8; 4] instead.Colour
type would live in it's own module to allow convenient use and manipulation. What's the best location for it?The text was updated successfully, but these errors were encountered: