godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

Add rotation of UVs to StandardMaterial3D #1230

Closed jasperbrooks79 closed 1 year ago

jasperbrooks79 commented 4 years ago

Describe the project you are working on: A Tomb Raider project . .

Describe the problem or limitation you are having in your project: It's a cool feature, in Blender, if rotate a tileable texture, random degrees, the sort of tiling effect, of similar textures disappear, for a lot of common surfaces ( grass, gravel, many more ) . . It would be nice if one could have a setting, to rotate the texture UV 90 degrees, at least, as this makes tiling much less noticable, or even 45 degrees . . .

2020-07-20 1527

Blender Guru made a video about it, I've been trying it, by rotating planes 90 degrees, and it really looks a lot better, but one needs to be able to rotate UV's 45 degrees, to almost remove it, completely, 95 % gone . .

2020-07-20 1528

Anyway, it makes 3D games look a lot better, I was hoping it could be in Godot 4.0, so we can't just offset, or scale UV1, UV2, but either rotate them by a random number, or hopefully 45 degrees, 90 degree rotation also looks a lot better, 50 - 60 % of tiling goes away . .

Describe the feature / enhancement and how it helps to overcome the problem or limitation:

Tiling textures tends to look very repeating, in the distance, having this feature ( 90 degree rotation is good, 45 degree angles are almost perfect, I guess 30 degrees would basically be enough, or a random 360 degree number, or setting ), any of those things would make Godot 3D worlds look a lot better, immediately, please consider . . .

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams: The pictures above show it pretty well, the amazing effect of being able to rotate UV's, like we can scale or, offset them, atm . . .

If this enhancement will not be used often, can it be worked around with a few lines of script?: I have got no idea, I'm just wondering why we can't rotate UV's, since we scale or, offset them, was hoping it might be a minor thing, to add to the engine, the effect is quite amazing, as can be seen above, 45 degree rotation values basically are enough, 30 degree, ie 30, 60, 90, 120, 150 so, on would probably be all one needs . .

Is there a reason why this should be core and not an add-on in the asset library?:

Well, we can already scale, and offset UV's, seems like rotating them is the missing bit . .

Thx <3

jasperbrooks79 commented 4 years ago

Effectively, one would only need one tiling grass texture, to make a nice terrain, or gravel, dirt, sand . . . Being able to rotate UV's in degree of 15 increments, would mean the same result, as 45 degree tests basically makes tiling unnoticable . . Thx <3 . . 2020-07-20 1538

Even if only 90 degree is possible, it makes everything look twice, as good, 45 degree is basically 90 - 95 % tiling gone . . . 30 degrees is probably all that's needed, or so . .

Calinou commented 4 years ago

We could replace the scale and offset parameters with a single matrix, so you can adjust the UV translation, rotation and scale with a single property. You'll even be able to shear UVs this way.

@clayjohn Do you think this is a viable solution? Or should we just add a rotation property instead?

fire commented 4 years ago

This is supported in GLTF2 spec. Will need to update importer though.

https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_transform#gltf-schema-updates

clayjohn commented 4 years ago

@Calinou I guess a single matrix transform is likely faster than separating into three transforms.

SIsilicon commented 4 years ago

As for the texture tiling, that will have to be done with shaders. Even if rotating UVs in the base material gets added, it wouldn't do much for you if the rotation can't vary. That's where shaders come in. Fortunately I found a resource where someone created this sort of texture sampler. https://www.iquilezles.org/www/articles/texturerepetition/texturerepetition.htm With that I converted one of them into a Godot shader.

vec4 textureNoTile(sampler2D tex, in vec2 uv) {
    // sample variation pattern    
    float k = texture(variation, 0.005*uv).x; // cheap (cache friendly) lookup    

    // compute index    
    float index = k*8.0;
    float i = floor(index);
    float f = fract(index);

    // offsets for the different virtual patterns    
    vec2 offa = sin(vec2(3.0,7.0)*(i+0.0)); // can replace with any other hash    
    vec2 offb = sin(vec2(3.0,7.0)*(i+1.0)); // can replace with any other hash    

    // compute derivatives for mip-mapping    
    vec2 dx = dFdx(uv), dy = dFdy(uv);

    // sample the two closest virtual patterns    
    vec4 cola = textureGrad(tex, uv + offa, dx, dy);
    vec4 colb = textureGrad(tex, uv + offb, dx, dy);

    // interpolate between the two virtual patterns    
    return mix(cola, colb, smoothstep(0.2,0.8,f-0.1*dot(cola-colb, vec4(1.0))));
}

The variation texture used in the function can just be a NoiseTexture. A 512x512 with a very low period and 1 octave should do the trick. image

jasperbrooks79 commented 4 years ago

I sort of knew, this could be done with shaders, but as a new user, it would be nice, if one could rotate the UV's, in the UV1 / UV2 settings, in the materials . . Even if it was only 90 degree increments, that makes textures look a lot nicer, less repeating . . .

I really hope you add it, as I can't code, I use visual script ( it's code, but not written, hard-core code, I find it VERY difficult ), and this feature would really help, and it makes sense, if there's scale, and offset, that rotate should also be there . . Hope, you can make it, perhaps with 45 degree increments, but 90 degree UV rotation makes it look amazing, as well . . . Thx . .

It would take me 2 - 3 months to learn to make a written code shader, I can't even write a character controller, atm . . Made it work, in visual script, but it was tough . . . This feature, would really help me, make nicer 3D scenes . . . Please, consider . . .

SIsilicon commented 4 years ago

I'll reiterate. Simply rotating the texture won't help break the repetition pattern. All it would do is move it as a whole. To achieve the effect you see in that blender video, you'd have to use a custom shader; visual or text based.

it, perhaps with 45 degree increments, but 90 degree UV rotation makes it look amazing, as well

I'd like to see a concept screenshot of what a texture would look like if it were just rotated an arbitrary angle (90°, 45°, etc...)

Calinou commented 4 years ago

@SIsilicon I suppose rotating and scaling two textures (UV1/UV2 detail map) might look a bit better, but probably not significantly so.

jasperbrooks79 commented 4 years ago

I took 12x12 meshinstances, with same texture, on one they're not rotated random 90 degrees, on other it is . . 2020-07-21 0943

Rotate 45 UV, and it looks basically, non-tiling,, almost . .

jasperbrooks79 commented 4 years ago

My estimate is, 45 degree rotation values, of UV1 / UV2, will mean you can rotate the underlying tiling texture, then add a next-pass material, to add road decals, or so . . 30 degree value increments would probably remove the tiling effect completely, but 45 degrees removes 98 percent, also, the one I made was pretty quick, problem is, some of my angle tiles can't be rotate, unless the UV gets rotated, they always look the same . . .

2020-07-21 1033

With ability to rotate textures 90 degrees, ie flip the UV's, for square textures, it looks a lot nicer, the above texture isn't the best example either, one can also use UV offset, on various tiles, to offset it, the tile effect, but rotating them works best . . If one could add rotate, to scale, and offset, that works best . .

When it's done right, instead of quick, it looks like Blender guru, from my attempts, 45 degree rotation values basically removes it completely, 98 % . . With a well-chosen texture, with a bit of work, tiling is gone, entirely . .

Ideally, if one could select some nodes, and click a button, to randomly offset and, rotate the tiles, 90 degrees, it would just work, so if I picked all the tiles, to the right, and clicked a button, it would offset them randomly, between 0 - 1, in x and, z direction, and also rotate them 90 degrees, a tiling land-scape would look non-tiling . . Basically it would just have to go through all the nodes, and assign a random number, to a larger selection, of nodes, looking for meshinstance nodes, it's a lot of work, to do it manually, for each tile, basically, we need to be able to rotate UV's, for each material, at least 90 degrees, 45 degrees would be better, with 30 degree rotation increments, as basically, non-tiling effect . .

Again, the texture I used isn't the most ideal, also . . :O

So, if I select all my tiles, in the scene dock, and there was a button, to randomly offset and, rotate UV's, within a certain range ( UV's + / - 0.1, UV rotation in 90 degree, 45 degree, or 30 degree random angles ), it would instantly make 3D worlds look better, that's my proposal, thx . . . It could be cool, if there was a special menu, for such ' rarely ' used features or, one could shift-right click selected nodes, to get a special menu, where such weird stuff was done . .

ghost commented 4 years ago

I am interested in this as well. I use custom shaders to get this effect on my projects. This is an often used effect for texturing ground and natural objects in games and it makes a huge difference. Other game engines provide that option without any need for users to get into shaders at all.

In my opinion adding different tiling options to the Uv1 and Uv2 sections would be the best way to do this.

Adding a matrix input that also allows global rotation and shear while at it would be nice, too. I was imagining that it looks consistent with the transformation options of a Spatial.

@Calinou using 2 textures that are different rotated and scaled and blending them together looks worse in my opinion. Basically you have a blend between 2 tiled textures. It may look good with some textures, but in general it doesn't solve the problem.

SIsilicon commented 4 years ago

I took 12x12 meshinstances, with same texture, on one they're not rotated random 90 degrees, on other it is . . 2020-07-21 0943

Rotate 45 UV, and it looks basically, non-tiling,, almost . .

I think I get where you're going with this. The exact same thing is done in Minecraft, but on 90° increments; specifically there grass texture. It breaks the tiling pattern there, but mostly because the texture was already very stochastic.

Ideally, if one could select some nodes, and click a button, to randomly offset and, rotate the tiles, 90 degrees, it would just work, so if I picked all the tiles, to the right, and clicked a button, it would offset them randomly, between 0 - 1, in x and, z direction, and also rotate them 90 degrees, a tiling land-scape would look non-tiling . . Basically it would just have to go through all the nodes, and assign a random number

I can see what that looks like by making a little script. Maybe it will look less tiling. There's just one problem. If you were to give each grid tile they're own UV offset, then they'd all have unique materials; each tile would have an independent material from the other. If scaled to a large landscape. This could be costly. I'll make a test and see how this would look. Edit: Nevermind. Redox already did that. ⬇️

ghost commented 4 years ago

So this is my take on it. On the left is the regular tiled texture and on the right the one with 'random' rotation for each tile. I did not snap the rotation to any number of °. Also the 'random generator' can be implemented really lazy from my experiments (I just use the coordinates of the tile multiplied by some prime numbers for now). If any one is interested I can pop in some other textures or snap the rotation to 45° or 90° steps. I can see why you want 90° steps in some cases. However I see no reason to have it snap to 45°, 30° or something else. Just don't snap them at all in these cases. screenshot I would be interested to work on this if you think this should be implemented.

Edit: To clarify: This is one plane mesh and the tiling is done in shader. I don't think it is costly. Should be the same cost as rotating the UV as a whole plus a few multiplications.

SIsilicon commented 4 years ago

I have experience with material based plugins. I could make a tile breaker add-on if you want. :)

jasperbrooks79 commented 4 years ago

I decided to try Quixel, but even those textures end up looking tiled, in the distance, having this somehow work, would be amazing, especially if one could batch select meshinstances, and then toggle ' Random UV Rotation On ' . . So, after making a plane, one clicks a button, and one can select which ' next-pass ' materials one wants to do it on, ie, index 0 ( first material ), index 1 ( first next-pass material ), so one could add decals, on top, or layer them, or so, with no rotation . . My 1x1 m planes, for making a tile 3D terrain, only have 4 points, so rendering them twice, isn't that big a deal, for small or, medium levels . . .

The above image looks really good, the tiling effect goes away, like it looks like a ' real ' are, or so . . I really like that, want that in my levels . . . What I mean by batch select is, if I make the, oh wait, you'll make a setting, where the global coordinates determine the rotation, in the material, like in Parameters . . . That, would be even better, . .

jasperbrooks79 commented 4 years ago

It would be pretty amazing, if one made it so, it was a parameter for the material, based on global position, to find the ' random ' rotation number . . That way, one could make a next-pass material, that was not rotated, to add decal roads, or so, or also rotate those next materials, for layered decals, terrain . . .

2020-07-21 1808

So, one could add decal roads, or transitions between grass and, sand, that wasn't randomly rotated . . . :O

jasperbrooks79 commented 4 years ago

Note, I don't think this should be an add-on, to asset library, as it would be almost impossible for new users to find it, among all the other projects, for this small feature . . I think it would be nice, if it was a parameter, under a material, like described above, if possible . . .

I think the results shown above, show that it's a good addition, especially if it's fast, as well . . .

SIsilicon commented 4 years ago

Here are a few points I'd like to make.

All in all, the tile breaking feature, unless proved to be widely needed by most Godot users, should stay as an add-on, that users may optionally install.

SIsilicon commented 4 years ago

As for the UV rotation, that sounds like a good idea to include the engine. That way the UV transformation capabilities are complete.

jasperbrooks79 commented 4 years ago

Yes, that's what I wanted, having 90 degrees would make, since textures are often square ( 512x512 ), so rotating them 90 degrees, would make sense, for most tiling ground textures, grass, sand, stone, gravel, or so . .

And yes, it would be good if Godot did not become needlessly bloated, that's why I think this setting would fit well, if it was added below the rotation, in UV, if this was added, ie each material has this setting, in UV1, not it parameters . . The results are quite remarkable, but bloating the engine is a big problem . . . Thx . .

That way, these settings are kept away, in the UV1 settings, where most users won't see them . . . One thing that might be nice, is if offset can also be set, to random, on some axis, this completely breaks the tiling, combined with rotation, but having a random rotation number is enough, ie random offset toggle, under UV1, is probably not needed . .

I tried adding a random offset, to UV's, and it also looked nice, but rotating them, is what works best . . . Keep Godot clean, that's all . .

jasperbrooks79 commented 4 years ago

Add, to lessen calculations, one could make calculations, so that it calculates the rotation random number, from position, and the just stores the number, in the UV rotation, ie the calculations only have to be done once, to make it fast . . So, once the multiplication is done, for each tile, it SETS the rotation number, to that constant . . It would also mean, if one moves the mesh later, it won't ' jump ', each time one moves it . .

However, it would be nice if one could re-do it, with a new random seed, if the first calculations somehow don't look ' good ' . .

SIsilicon commented 4 years ago

Well then, it would be your job to make a script that does just that! You don't even have to fiddle with the UV rotations (which I don't recommend). Just rotate the mesh objects themselves. :) You know how to visual script anyway.

jasperbrooks79 commented 4 years ago

I could attach a script to each plane, that does that, but it only works for flat planes, the angled planes I have, for corners, hills, lowerings, don't do that, if they rotate, the terrain isn't like, ' all one ', or intact . . . But, I could attach a script to all the 100 % flat planes, just not, the angled ones, I would probably need sort of, figure out how to rotate the UV's . . :(

SIsilicon commented 4 years ago

Ah, but that also comes with its own problem. If you try to rotate the UV on one plane, it'll affect everything that shares the same material, i.e. all of your ground planes. This would totally prevent from giving each plane a different rotation. To solve that, you'd have to make each plane's material unique. This means that Godot would have to render more materials, which probably would hinder your performance; especially when you have a lot of these planes. This is why I say the solution would be to use shaders, but you can do what you want.

jasperbrooks79 commented 4 years ago

Yes, it's really complex, to do that, I'm stuck . . . :( :(

SIsilicon commented 4 years ago

How about this. Try the plugin I'm working on when it's finished, and see if it solves your issue. If so, then great! :)

ghost commented 4 years ago

as I see it, we are talking about two slightly different problems here. The case @jasperbrooks79 is interested in is when you have each tile as separate MeshInstance. However the video he linked and my proposals are about the tiling of a texture when applied to a single, larger MeshInstance as you would have if you work with height maps for example.

I think the 2nd case is more common and as I said, this is implemented in other gameengines as well and is a great benefit for almost everyone looking to make (photo realistic) games that include some kind of textured ground. I totally agree that we shouldn't bloat godot and this could be easy implemented as addon or a shader in the asset store. However, when I look at the SpatialMaterial there are other features implemented that I find less important. This just instantly can make the game of a beginner look so much better since the ground usually gets a lot of screen estate.

Having such a shader option would also work for the special case @jasperbrooks79 is interested in (if the implementation is right). Not sure how @SIsilicon plugin will work, but you should avoid to have different materials for all the tiles (because of performance). Instead I would advice @jasperbrooks79 to use a shader. If you want I can help you with that, but here is not the right place to discuss individual solutions, I guess.

jasperbrooks79 commented 4 years ago

Yes, what I'd like is simply to be able to rotate the UV's, like one can offset or, scale them . . That would fix all my problems, since I make 16 x 16 areas, and just have to do it once, then I can copy paste them, for a larger terrain . . Basically I just want to add Rotate to UV1 / UV2, anyway I have been wondering why it's missing, maybe because textures often look bad, when rotated, but for square textures, rotating them 90 degrees, would still make the same UV fit the plane, or model, for ground or, terrain meshes, however, I don't know if adding a rotate 45 degree is very advanced, 30 degree increments would be enough, but maybe it's just as easy, to just make a 0 - 360 degree integer, or a float, ie it won't impact performance, or cause graphical errors . .

I understand Godot should not be bloated, that's why my first suggestion, was to add rotation, since it seems missing to UV1 and, UV2, however not sure if adding a float rotation value would be very taxing, on the game, a 90 degree rotation removes 50 - 60 % of tiling, and square textures, especially terrain, would look so much better . . . However, it might be just as easy to make a more complete rotation number, like offset is a float, 0 - 1, so I'm not sure . . I don't think it would bloat Godot's interface to get rotation added to UV's, in materials, and it seems a bit odd it's not there . . For starters, a 90 degree rotation would be a nice addition, with sub-sequent next-pass materials not having that rotation, if possible . . .

Anyway, that's my suggestion, but a value between 0 - 360, or even a float, would be supreme . . . :( . .

Basically, I don't need the randomize rotation automatically, as I make 16 x 16 tileable terrain scenes, and just copy-paste them, for larger areas, and also rotate them, before placing them . .

When it's done for one 16x16 m tile ( made of 1x1 m planes, that are placed individually ), I can just rotate the larger 16x16 tile, and place it next, to others, or so . . :O

ghost commented 4 years ago

I feel like you miss my point. How about this:

  1. We make this issue about adding global UV rotation to the already existing scale and offset options (I would support that as it feels logical to have rotation as well).
  2. However I still think there should be an option for rotated tiling on the same material (when resizing the Uv) as described in the video. So I will open an separate Issue for that (What is the right therm for that?). What do you think?
SIsilicon commented 4 years ago

Not sure how @SIsilicon plugin will work, but you should avoid to have different materials for all the tiles (because of performance).

How it works is that for every material you want tile-less textures, you attach a script to it. What the script will do is transform the material's shader into one that uses a tile-less texture sampler, and set it directly into the VisualServer. That way, nothing in the core part of Godot gets affected, and the process will be very clean and user friendly. But unfortunately this has nothing to do with UV rotation. That's a totally different issue. If you feel like tile-less texture sampling should be part of Godot @redoxCode, then you can make another proposal, and we all talk about it there. :)

jasperbrooks79 commented 4 years ago

The better a feature we get, without bloating, I support it . . .

SIsilicon commented 4 years ago

Alright! Here is the addon so far. It currently supports Spatial materials, and materials that use a Visual shader. image Left: default tiling behaviour, Right: my tile breaker silicon.vfx.tilebreaker.zip

SIsilicon commented 4 years ago

First turn on the addon by going in the ProjectSettings and enabling it there. Then to add a tile breaker to a material, simply select the material, click on the SpatialMaterial option at the top and press Add Tile Breaker. image The quality option for this can be found in the rendering quality tab in the ProjectSettings.

ghost commented 4 years ago

I have been quite busy the last days. But it looks like your add on turned out quite nice. I will test it the next days. Will you make a git repo for that? I am a little frustrated with the godotmarketplace, but that might be the topic for an other issue...

Calinou commented 4 years ago

I am a little frustrated with the godotmarketplace, but that might be the topic for an other issue...

Godot Marketplace isn't an official asset store. We also have no way to prove that they actually donate 10% of their proceeds.

jasperbrooks79 commented 4 years ago

Can you make some examples, using some open source PBR textures, ie grass, stone, rock, dirt or, so . .

Also, on a flat plane, can't really see if it works . . .

Also, I still think adding ' set ' rotation in UV1 is a needed feature, makes sense, to have it . . Thx . .

I'm a bit worried about using external stuff, as it might make the engine unstable, sry . .

jasperbrooks79 commented 4 years ago

Like, this one . .

https://www.cgbookcase.com/textures/grass-01?source=textures.one

Hope, it's not too much work, would like to see demo, on a flat plane, or that . . . ;) . . Also, with normal map, metallic, AO . .

ghost commented 4 years ago

I am a little frustrated with the godotmarketplace, but that might be the topic for an other issue...

Godot Marketplace isn't an official asset store. We also have no way to prove that they actually donate 10% of their proceeds.

oh, sorry. I was thinking about the official asset store....

SIsilicon commented 4 years ago

@redoxCode said: Will you make a git repo for that?

I sure will! I'll also release it in the asset library for others to use. :)

@jasperbrooks79 said: Also, I still think adding ' set ' rotation in UV1 is a needed feature, makes sense, to have it . . Thx . .

Yeah I understand that, but that's a feature this plugin is not meant to implement. Someone would have to make that in a Godot pull request for better integration.

Can you make some examples, using some open source PBR textures, ie grass, stone, rock, dirt or, so . .

Definitely!

I'm a bit worried about using external stuff, as it might make the engine unstable, sry . .

I'll be putting this in the asset library anyway, so you can download it from there instead.

. . Also, with normal map, metallic, AO . .

I think using metallic and AO would be over the top. Don't forget that the usual use case for this is in large, organic landscapes. Showing it off with albedo and normal maps should be enough.

jasperbrooks79 commented 4 years ago

Thanks ! ! :O

SIsilicon commented 4 years ago

Alright! The asset is currently pending to show up in the asset library right now, so you may download it here on GitHub for now. https://github.com/SIsilicon/Tile-Breaker-Plugin

jasperbrooks79 commented 4 years ago

Okay, I'm looking at the page, it looks really good . .

Uhmm, is there a way where one can see, like if you only rotate them, randomly, but don't blend them how it looks . . As blending is more performance requiring . . . Also, can you make a plane, that's maybe 32x32 m, and make it on that, and show from the top, almost, not from an angle, like . .

2020-07-21 0943

I have to admit, the plug-in looks very good, but I was just looking for something, that let me rotate the textures, like offset, or so . . I worry about performance, rotating them could be a pretty large fps drop, not sure . . Anyway, it looks really good, on your page, with decals being added, it will be possible, to make say a ' decal ' road, as well, on the terrain, or add stuff like twigs, or debris, to the ' untiled ' environment . . Effectively, giving Godot a terrain painter . .

Please make some images, of two planes, that are a bit bigger, on a 4x4 m terrain, it's difficult to see the tiling, or if it goes away, or it's just random . . Also, the first image of hill, looks good, but it's not a good angle, for seeing how it works, like if you could post a few more pictures here, like the above one, I'm not sure . . .

jasperbrooks79 commented 4 years ago

Okay, I'm reading on the page, and I think this feature would be nice, to have in Godot, like official . .

But, the concern is, how to avoid bloating the user-interface . . I definitely think this is something I want in Godot, as full support, at least rotating the textures, along with offset, and scale, ie just adding rotation, to offset, and scale, in UV1 / UV2 . .

It's pretty amazing, how good it looks . . It just instantly makes a boring 3D world, look 100 % better, and it's a very simple thing, I hope this get put in Godot engine, like a normal method, for tiling . .

However, the question is, then, where to add it, to avoid bloating, ie there could be a menu somewhere, where such weird things were placed, like ONE menu, placed somewhere, where such things are, so it only becomes one button, in Godot, like you did, in the plug-in, atm . .

SIsilicon commented 4 years ago

@jasperbrooks79 said: but I was just looking for something, that let me rotate the textures, like offset, or so . .

I think you're over complicating the problem. You wanted to have no visible tiling in your texture, and this plugin provides exactly that. Infact, the pictures you have in this proposal are doing exactly what I'm doing: making a material that removes tiling patterns.

I worry about performance, rotating them could be a pretty large fps drop, not sure . .

If you think rotating the textures could be performance heavy, what the point of all this? Other than that, if performance is your concern, then just set the quality to Low. It still looks fine on that setting, and it really isn't that taxing on the GPU.

Also, the first image of hill, looks good, but it's not a good angle

If you don't think it's a good angle, then could you please take a screenshot of the terrain at a different perspective for me? I'd like to see what angle you have in mind.

Okay, I'm reading on the page, and I think this feature would be nice, to have in Godot, like official . .

Please refer to my previous comment. https://github.com/godotengine/godot-proposals/issues/1230#issuecomment-661963136

jasperbrooks79 commented 4 years ago

Okay, gonna look at it, thanks . .

jasperbrooks79 commented 4 years ago

Uhm, can this shader work, with Zylann's terrain plug-in, ie. can be combined . .

Thanks . . . :O

sairam4123 commented 3 years ago

Hi. Is there any plans to add this, can I possibly work on this if necessary?, I'd like to know more. Thank you very much!

Calinou commented 3 years ago

Hi. Is there any plans to add this, can I possibly work on this if necessary?, I'd like to know more. Thank you very much!

Feel free to open a pull request to add UV rotation to StandardMaterial3D (SpatialMaterial in 3.x), but note that this proposal was kind of misguided in the first place. OP does not need texture rotation – they need a tilebreaking feature, and that's better left to an add-on due to the added shader complexity.

npip99 commented 1 year ago

Concur that this idea seems misplaced.

StandardMaterial3D should just continue to have options that mimic Blender's Principled BSDF; take in Albedo/Normal/Specular/Roughness/Metallic/AO, and then generate a realistic PBR material.

If you want to customize it, we already have "Right click -> Convert to Shader Material", where you can just multiply UVs by a mat4. You can even expose the mat4 as a uniform too so that you can mess with various rotations from the Godot editor. Even if you've never interacted with shaders before, that's a perfect way to learn, it's just a 1-line change (Multiply UV by a mat4).

It's not possible for StandardMaterial3D to have all of the options necessary to handle the millions of useful 1-5 liner changes that make materials better in highly specific circumstances. Hence it's good to keep StandardMaterial3D as (Albedo/Normal/Specular/Roughness/Metallic/AO) => PBR material, and if you want to mess with anything beyond that you open it up and make whichever edit you please.

If the goal to expose further functionality for those who don't want to code, the solution still wouldn't be to add more options to StandardMaterial3D. It would best be to keep StandardMaterial3D as-is, and give visual programming solutions such as the ability to insert a transform node in-between the UVs and the "StandardMaterial3D" node and connect them like you would in Blender's shader node editor.

Calinou commented 1 year ago

Closing in favor of proposals like https://github.com/godotengine/godot-proposals/issues/8366, which are better suited for this kind of extensibility.