We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

jem

Forum Replies Created

Viewing 15 posts - 76 through 90 (of 173 total)
  • Author
    Posts
  • jem
    Customer

    Hi Mikhail,
    This is an excellent list of suggestions. I know that I forget to do many of these optimizations before I release a 3D scene. They are going on my scene optimization checklist!
    Thanks

    Jeremy Wernick

    jem
    Customer

    Hi Mikhail,
    Vertex colors! I did not think to look at those. That is a very good solution for simulating glass thickness. I learn something new every day. I will have to use this technique in my own work.
    Thank you for the explanation and for the great work.

    Jeremy Wernick

    in reply to: Another nice car visualization #21741
    jem
    Customer

    That is very pretty, but may I suggest that VMT compress their assets? The bin file for that car is 22MB. It should easily compress down to about 7MB. Please keep in mind that most CMS systems and CDNs do not gzip large bins on-the-fly for HTTP transfers so it is crucial to pre-compress such an enormous static asset.

    Still, it is very nice. :good:

    Jeremy Wernick

    in reply to: Verge3D 2.17 pre1 available! #21287
    jem
    Customer

    Hi Alexander and Yuri,
    Wow! I have been considering the idea of using headless Chrome for a server-side render farm. It seems that you are ahead of me. Thank you so much!

    Jeremy Wernick

    in reply to: How to Manage and Share the Puzzle Library #20853
    jem
    Customer

    Thank you and the team very much!

    Jeremy Wernick

    jem
    Customer

    @GlifTek, I often have the same requirement. I need to load specific objects into a 3D scene on demand. As Yuri pointed out, the Verge3D engine must load and parse a complete GLTF file just to be able to load one of the objects within it. In my scenes, this would be an incredibly inefficient technique (the user experience would suffer). I have scenes with hundreds of objects that could be loaded. Only a small handful are ever loaded during a single end-user’s session. These libraries of objects can be hundreds of megabytes in size. This is why I keep all of the objects that can be loaded on-demand in separate GLTF files. I know that managing a large number of separate GLTF files can be cumbersome, but here is the technique that I developed to make that more manageable:

    1. Develop a descriptive naming system for all objects. In engineering, this is sometimes called an intelligent part number.
    2. Place all objects in a single Blender file. Putting them in one place makes processing them more efficient.
    3. Keep an inventory of all of the objects in the Blender file in a CSV file. This file can come in handy for other purposes such as project management.
    4. Write a Python script in the Blender file that batch export a separate GLTF file for each of the rows in the CSV.
    5. Develop logic in your puzzles that concatenates strings and values to create the required intelligent part numbers when needed.
    6. Use puzzles to load that part and that part only.

    This may seem like a lot of work to set up, but it is work you will only do once. After that, you can cut and paste it into your new projects. I find that being able to produce 500 GLTF files with the press of a single button is magic. This also makes updating to the latest build of Verge3D fast and easy.

    Jeremy Wernick

    in reply to: Which Shader Nodes/Maps Can I Use? #20411
    jem
    Customer

    Thank you!

    Jeremy Wernick

    in reply to: How to Resize model in AR mode. #20385
    jem
    Customer

    I like this question. It really points out the difference between the 3D web page experience and the AR experience. I think that we, as 3D developers, have to think carefully about the AR experience that we build for our users.

    When I use Verge3D on a web page, I can pan and zoom the scene. I can do this with touch or with a mouse. In this case, panning and zooming are moving the virtual camera. This user interaction does not change the size of the 3D object(s).

    When I use Verge 3D in AR, I can pan and zoom the 3d scene by moving the phone or tablet that I and using to view the AR world. In my experience, Google AR services do a good job placing the 3D geometry into the real world at the scale at which they were drawn. For example, if were to draw a 1-meter cube in Blender, the AR system renders the cube at a scale that makes it appear to be 1-meter.

    In the AR scenario, should we allow pinch-to-zoom? If we did, the pinch-to-zoom would be changing the scale of the 3D meshes. This is a different behavior that pinch-to-zoom in a webpage (where this gesture is interpreted as a dolly camera move). Maybe the answer is to build on-screen tap (not drag) controls that only appear in AR mode that explicitly affect the object scale?

    These are just some ideas. This is not a criticism of the Verge3D system. AR is new and I think that we need to work on the user experience and establish some best practices. I am curious to see what solutions other users have tied to implement.

    Jeremy Wernick

    in reply to: How Many Textures does this Material Use #20372
    jem
    Customer

    Yuri, thank you for the explanation. It will help me with my projects. :good:
    @3DPixel, I will check out the Visual Studio Code extension that you linked to today. Thank you.

    Jeremy Wernick

    jem
    Customer

    Hi Yuri,
    I have run into this issue in the past. I think that there is a thread on the forum on this topic from about a year ago. I know that this is an Apple issue and I wish they would fix their software, but is there a way that we, as implementers, can see the number of textures in a material? It would be convenient if the export log showed the number of textures per material. This would be similar to a compile-time warning if I were writing in C. I could use this information to fix Apple issues before I moved to QA.
    Even if I had this information, it would not be perfect because of lights and shadows. I think that a light with a shadow adds a texture to a material at run time. I would just have to keep that in mind when I was trying to stay under the Apple texture limit of 8.

    Jeremy Wernick

    in reply to: Removing cloned geometry #20280
    jem
    Customer

    @mugga, yes, this makes sense. I think that you will have to use the MeshNodeMaterial if you are only using HDRIs for lighting. Materials exported from Blender or 3ds use MeshNodeMaterial. This material is complex and challenging to create from scratch in JS code, but I do have an easy solution to this issue. Write some JS code to clone the material, change the RGB values of the base color, and then apply the newly cloned material to the newly created cloned object. This technique is simpler to implement than it sounds. I do not know how you set up your material nodes in Blender, but I will make two assumptions. First, the object from which you create the clones uses a Principled BSDF shader. Second, an RGB value node called “RGB” sets the base color in the Principled BSDF shader. I have included a screenshot of this node set up.

    Now, we need to rewrite the custom setObjectColor() function. Here is the new code:

    	//Create a material and assign it to an object
    	app.ExternalInterface.setObjectColor = function (object, red, green, blue) {
    		var newMat = app.scene.getObjectByName(object).material.clone();
    		var rgbIndex = newMat.nodeRGBMap['RGB']; // 'RGB' is the name of an RGB node
    		newMat.nodeRGB[rgbIndex] = new v3d.Vector4(red/255, green/255, blue/255, 1); // new color in RGBA format
    		app.scene.getObjectByName(object).material = newMat;
    	}

    This code is partialy based on the example in the documentation:
    https://www.soft8soft.com/docs/api/en/materials/MeshNodeMaterial.html
    I have attached an updated project (dummy.zip) that has the new JS code and is only illuminated with an HDRI environment.
    Please give this a try and let us all know if it works for you.

    Jeremy Wernick

    in reply to: Flexible Texture Width #20121
    jem
    Customer

    @hoody, I don’t know why your node set up is not working, but I am not using 2.81 yet. I don’t have experience with the new mapping node. However, simple shifting and scaling of a texture map are relatively straightforward, even in 2.80. I did not have an example that I could share with you the last time I posted, so I put together a small example this evening. Maybe this shader will help others here in the forums, as well. I have included the full project archive so that you may examine it. There is nothing tricky in the transform other than keeping track of the signs (+/-). If you get the sign wrong, the texture will move in the opposite direction of what you intended.

    Jeremy Wernick

    in reply to: Removing cloned geometry #20100
    jem
    Customer

    @mugga, the code is simple, so I just wrote the function. The setObjectColor function expects RGB values as ints between 0-255. If you have some other color format, the code is easy to adapt. This code goes in the ExternalInterface section of your main JS file.

    	//Create a material and assign it to an object
    	app.ExternalInterface.setObjectColor = function (object, red, green, blue) {
    		var colorHex = "#";
    		colorHex += toHex(red);
    		colorHex += toHex(green);
    		colorHex += toHex(blue);
    		var material = new v3d.MeshLambertMaterial({ color: colorHex });
    		app.scene.getObjectByName(object).material = material;
    	}
    	 
    	function toHex(rgb){
    		var hexStr = Number(rgb).toString(16);
    			if (hexStr.length < 2) {
    			hexStr = "0" + hexStr;
    		}
    		return hexStr;
    	}
    

    Jeremy Wernick

    in reply to: Removing cloned geometry #20095
    jem
    Customer

    @mugga, I think that you will run into issues trying to change the color of each clone independently. Color is an attribute of a material. All clones will have the same material as their source. That is, there will only be one material, not many copies of the same material. If you were to change the color of the material, the color of all of the clones would be affected. You will need a unique material for each clone. If you only had a minimal number of clones, you could create a few materials in Blender ahead of time and apply one of them to each clone. I suspect that you will have far too many clones to make that approach practical. You can create a JavaScript function to make new materials on-the-fly and apply them to the clones as you create the clones. Here is a link that explains some of JS material system if you are interested.
    https://threejsfundamentals.org/threejs/lessons/threejs-materials.html
    https://www.soft8soft.com/docs/manual/en/programmers_guide/Programming-basics.html
    https://www.soft8soft.com/docs/api/en/materials/MeshLambertMaterial.html
    Most three.js examples will work in the Verge3D engine. Just change the name of the library object from “THREE.” to “v3d.”

    Jeremy Wernick

    in reply to: Flexible Texture Width #20088
    jem
    Customer

    @hoody, It seems like Blender 2.81 is not the default application associated with .blend files on your system. As 2.81 is beta software, you might not want to make it the default file handler but that is up to you. The easiest solution is to open 2.81 and then open the file from there (rather than opening it from the Verge3D application manager).

    Jeremy Wernick

Viewing 15 posts - 76 through 90 (of 173 total)