Code Monkey home page Code Monkey logo

Comments (9)

lilleyse avatar lilleyse commented on May 31, 2024 1

I found at least one problem here - CesiumGS/gltf-pipeline#197. Once that's merged I'll update obj2gltf.

from obj2gltf.

lilleyse avatar lilleyse commented on May 31, 2024 1

@webprofusion-chrisc obj2gltf is now published with the fix

from obj2gltf.

lilleyse avatar lilleyse commented on May 31, 2024

I upgraded to a newer version of the gltf-pipeline and this issue seems to be fixed. Once #38 is in can you verify?

from obj2gltf.

webprofusion-chrisc avatar webprofusion-chrisc commented on May 31, 2024

Thanks! I'll check this out and get back to you.

from obj2gltf.

pjcozzi avatar pjcozzi commented on May 31, 2024

@webprofusion-chrisc I merged #38. Let us know if this is still an issue.

from obj2gltf.

webprofusion-chrisc avatar webprofusion-chrisc commented on May 31, 2024

Tried this out but unfortunately with the models I've tried I now get a shader error (loading using the threejs gltf loader). I can share the .obj privately if that helps. This fails in both firefox and chrome but only chrome reports the error. Obviously this could be a an issue with the threejs glTF loader but I wondered if you'd seen a similar error with anything else?:

Failed to load resource: net::ERR_INVALID_URL
data:text/plain;base64,precision highp float;uniform vec4 u_ambient;uniform vec4 u_diffuse;uniform vec4 u_emission;uniform vec4 u_specular;uniform float u_shininess;uniform float u_transparency;varying vec3 v_positionEC;varying vec3 v_normal;void main(void) { vec3 normal = normalize(v_normal); vec4 diffuse = u_diffuse; vec3 diffuseLight = vec3(0.0, 0.0, 0.0); vec3 specular = u_specular.rgb; vec3 specularLight = vec3(0.0, 0.0, 0.0); vec3 emission = u_emission.rgb; vec3 ambient = u_ambient.rgb; vec3 viewDir = -normalize(v_positionEC); vec3 ambientLight = vec3(0.0, 0.0, 0.0); ambientLight += vec3(0.2, 0.2, 0.2); vec3 l = vec3(0.0, 0.0, 1.0); diffuseLight += vec3(1.0, 1.0, 1.0) * max(dot(normal,l), 0.); vec3 h = normalize(l + viewDir); float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)); specularLight += vec3(1.0, 1.0, 1.0) * specularIntensity; vec3 color = vec3(0.0, 0.0, 0.0); color += diffuse.rgb * diffuseLight; color += specular * specularLight; color += emission; color += ambient * ambientLight; gl_FragColor = vec4(color * diffuse.a, diffuse.a * u_transparency);}

from obj2gltf.

lilleyse avatar lilleyse commented on May 31, 2024

It looks like the shader isn't being base64-encoded properly. I thought this was fixed but maybe not - you can send the model to [email protected].

from obj2gltf.

webprofusion-chrisc avatar webprofusion-chrisc commented on May 31, 2024

Thanks! Have tried this out and it's working well. I noticed I had trouble getting UVs to work for files exported from Rhino as .obj with long lines wrapped - wondered if that was a known issue? Unchecking the option to wrap long lines in the rhino export seemed to fix it.

from obj2gltf.

lilleyse avatar lilleyse commented on May 31, 2024

I'm not too surprised that it would fail for wrapped lines since the obj parser reads line by line. Do you have a sample obj that I can look at though?

from obj2gltf.

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.