Colors coming through incorrectly from VRML

vrml

(Reed Copsey, Jr.) #1

When uploading VRML containing lines with vertex colors, Sketchfab doesn't honor the original input:

This should look more like the following:

The VRML (VRML 1.0) is simple, and obviously correct. The Material specification for these lines is:

  Material {
   ambientColor 0 0 0
   diffuseColor 0 0 0
   emissiveColor [
    1 0 0,
    1 0 0,
    0 1 0,
    0 1 0,
    0 1 1,
    0 1 1,
   ]
  }

Note the 3 distinct colors for each vertex (unshared) of each line segment.


#2

Sorry this thread was never answered. I think we've already discussed this in other threads and/or over email?


(Reed Copsey, Jr.) #3

@james This specific issue was never discussed - this was actually the result of further investigation based on other threads/email.

As far as I can tell, this is just a flat out bug in the import process, and still a problem today. We've managed to work around most of the other issues, but this one still hits us, and we have no workaround (other than not using colors on lines, which is a pretty poor workaround).

I really tried to distill this down to a simple, reproducible case - as you can see, the entire problem space fits into that tiny VRML, and demonstrates the problem.


#4

Thanks for following up.

I disabled the texture on that material so that the lines are just using Vertex Colors, and it seems correct?


(Ctech) #5

James,

That specific VRML didn't include any texture information - so textures shouldn't need to be disabled manually.

In a large file (many objects with many materials), that becomes extremely onerous.


#6

@mrchlblng any ideas?


(Mrchlblng) #7

@ReedCopseyJr, @ctech, @james when looking at the gunziped content from the "Bad colors" upload, I see

    Texture2 {                                                                                         
  wrapS CLAMP                                                                                       
  wrapT CLAMP                                                                                       
  image 6 2 3                                                                                       
    0xff0000 0xff0000 0x00ff00 0x00ff00 0x00ffff 0x00ffff 0xff0000 0xff0000                         
    0x00ff00 0x00ff00 0x00ffff 0x00ffff                                                             
 }

We extract this to a texture ("skfb_texture_extract_0.jpg").
We have a default case when a model has a single texture, we bind it to the diffuse slot which makes sense for the large majority of models uploaded on sketchfab.

If you remove the Texture2 nodes, the model will process as you'd expect. Would that work for you?


(Reed Copsey, Jr.) #8

We have a default case when a model has a single texture, we bind it to
the diffuse slot which makes sense for the large majority of models
uploaded on sketchfab.

@mrchlblng : This seems like an extremely poor choice for VRML, at least. No other renderer does this, and it's a violation of the VRML spec.

In most cases, trying to avoid this on the export would be extremely difficult (if not impossible, depending on the combination of outputs).

I can understand why you'd do this for some formats, but its just wrong with regards to VRML.