This question continues the security discussion from
Let’s say, you have protected your files from being directly downloaded (by encryption or another technic), there is still the possibility for someone to get the objects geometries from webGL buffers.
What can I do to protect geometries from being copied?
To my knowledge, it exists no standard solution to this problem, but it exists approaches to alter the data and make it unsuable if stolen; almost like protecting an image file with watermarks.
Here are 3 of these approaches, each having its own level of protection, performance and implementation/integration difficulty and they can be combined to improve in overall protection:
Bind/merge a signature geometry to the geometry you wish to protect. The signature geometry should share as many vertices with the original one in order to make it difficult to remove if copied. Multiple signatures could be used to increase in protection.
Inject the geometry with vertices at specific positions (around the geometry you wish to protect) containing the factor of 2 large prime numbers, pass one of the prime to the shader. If the division of the prime with the vertex position returns an interger then don’t display the vertex.
Tag the geometry by shifting the vertices with a unique signature number (with a proprietary algorythm) that could be retrieved if the object is stolen (sort of legal proof).
There are certainly many more ways to secure your objects and the risk of having your work stolen still exists, but by using these methods, you could say that you have at least done something about the problem.
Just to correct this misleading quote, lekxi was me Discourse just didn’t let me change the name.
As i said there is simply no way to protect assets except serving a watermark as preview, code doesn’t even has to be reverse engineered, just grabbing the bare buffers, with textures being exposed in devtools anyway. The only semi-reliable method is branding it with a hidden watermark as i described, but this is only usefull for selling/previewing assets, not for games.
The best watermark/fingerprint for the geometry would be slightly displacing vertices or just a single, different from the original mesh that will be sold, this way there is no obvious garbage in the geometry with it being unknow to the thief what will be different from the original.
Otherwise as long as you’re not working on a platform like Sketchfab this shouldn’t be a subject to spent too much time and resources into. I’m using a proprietary format, which is clearly enough to prevent the absolute majority from theft, unlike if you were using a common format such as GLTF or FBX.
If you do work on a platform like Sketchfab, i would do the watermark approach plus changing the code, possibly in intervals of the encoding and decoding in order to prevent people creating tools they sell for mass theft, as it happens with Sketchfab with asset grabber even being shared on github. But for something like this i would go an entire differently route anyway that doesn’t even transfer the assets to the client.
To address the topic title: you could obfuscate the buffers to prevent straight grabbing them, but this is over the top for games, but useful for asset previews. Geometry can be encoded with displacements the vertex shader can place in the correct position again, for textures this is more complicated as you will have to do the linear interpolation yourself making sure every sample is decoded, or for displaced texels the right texel being sampled from.
Hey Fryestar, what’s the best way to apply the watermark? Right now if the 3d model has textures, I apply the watermark in a pattern on the texture that shows in the 3D preview. However, for models without textures what would the best way be to apply watermark to the geometry?
What i was talking about was rather a fingerprint than watermark, other than a watermark the purpose is that it’s not visible, the changes applied to the preview-only version are not visible and something impossible to find, as i described by using a simple pseudo random function to displace vertex positions by a invisible fraction.
In a automated way you can then check if a model is from a preview, using displacment directions you’re independet of scale changes as it might happen from conversion in different tools.
Subdivide each patch with sufficient intermediate vertices and engrave a watermark as displacement. This will effectively increase the geometry size.
However, I’m not sure the efforts to make this are worth the trouble. Enthusiasts may still download your model, use Blender or other tool to flatten the engravement.
Merging the watermark image to the geometry would require the scrappers to load the model into a 3d modeling software to remove the watermark right? I’m thinking of a solution similar to how shutterstock uses watermark on their images (models with textures are easy since the textures are equally important as the model and can be watermarked).
There isn’t much of visible watermarking you can do on the plain geometry, anything applied by additional data like vertex colors can be easily removed. And methods altering the mesh visible distort them negatively affecting the view on it unlike a image watermark overlay you can separate visually.
The only real visible kind of watermark that isn’t easy removable i can think of right now is literally embedding geometry watermarks, preferably so they are connected with nearby vertices of the mesh many small across the entire geometry - also requires Uvs to be mixed up randomly + overlapping with the original mesh.
Similar like engraving it by displacement however it’s in one or another way removable, also heavily depending on how advanced a modelling tool is, possibly better suited for lower poly models, less for already high poly. Both would require some modelling skills to remove, my suggested needs a careful implementation to not make it distinguishable. Visually however both might not look very pretty, engraving creates distortion that might end up in clipping and while embedded 3D watermarks do not distort the model at all, the watermark itself might have a ugly soupy look as the uvs need to be distributed in the same UV set with legit coordinates.
Yea I think that’s the problem, making sure the end result looks good. I’m leaning towards merging watermark to the geometry and adjusting the distance so that the watermark is visible.
However, I’m not sure how good it will look for more complex models with a lot of different faces. Is there a viable way to determine if there’s enough space to fit the watermark to ensure it’s not distorted on the model?
Nobody is gonna want to steal your models. If someone does want to steal your models, they can find a way. You will waste a lot of time and development energy time trying to prevent something that will in all likelihood A. never happen. or B. be easily circumvented… or C. generate a bunch of unusable geometry out of a bunch of useful geometry.