Grass transparency problem

Users who are viewing this thread

Soil

Grandmaster Knight
I'm remaking the terrain for my mod and I'm currently working on the flora.

I got a prototype of my grass in game, it works like it should


exsqbht981op6r73c3ri.jpg

except

5uqybj3h77jztrdl9cp.jpg

The last picture is the back side of the grass shown in the first picture. I marked the part where the problem is very obvious.

If this problem occured on both sides, I'd simply think it has something to do with parts of the texture not being fully transparent, but mostly transparent and therefore 'covering' the other grass, making the parts around the grass see-through. I actually do think that's the problem, but why does it only occur on one side?

If it's of any improtance, I couldn't be arsed to figure out how to export 2-faced obj models from blender so I just duplicated the model and inverted the normals.


Thanks for reading and I hope someone can help me.

 
I think the issue is with the grass being drawn when in distance and how the game sparses the grass. I'm not sure I understand exactly what your problem is.

Soil said:
I'm remaking the terrain for my mod and I'm currently working on the fauna.

Flora, not fauna. Fauna are animals.
 
Ack, damn it. I blame lack of sleep. Very emberassing  :oops:


Hmm, well, maybe these two screenshots help:

vbio4ox98j3vs4ipu9lq.jpg



vgdmsm6e6lzexe51qq1.jpg

It's the same grass objects in both pictures, just looked at from different sides.
 
what I would do if I was you was replace the native texture for grass temporarily to check whether its the mesh or the material causing the problem
I would assume it is the material and the problem is that you dont have the correct blending tags checked?, i dunno.
 
I guess I would've been able to find a way to fix it if I had the problem on both sides. The strange thing is it's only on one side... it works just like it's supposed to on the other side. I didn't change anything about the materials.
 
Much better example. I can see what you're saying, now. Looking at the grass.dds (did you edit this?), there appears to be a texture for each side or it may be used for different variations. I'm not sure. I would check to make sure your alpha channel is correctly aligned with whatever grass you're using.
 
Well yes, I remade the grass texture. I really doubt there's a different grass texture for each side because I think native grass simply uses double-sided faces so the texture is the same. Even if it did, I uv-mapped my grass mesh so every face has the same texture on both sides. And that's what surprises me, even though both sides have the same material(and shader, of course) and the same texture(well, like I said, I duplicated one face and simply inverted the normal[I guess this might be what's causing the problem, I'll have a look into that]).
That means if there was really something wrong with the texture/material it would show on both faces. Or that's what I'm pretty sure about.
 
I know that seems strange, but that was the only thing I could come up with. I've never edited the grass, so I can't rightly say. My guess is that it is an alignment issue with the alpha channel on the texture you inverted. Hopefully someone who may have more experience with the grass can chime in. What does your grass texture look like? If any part of the background is white, try changing it to green and see if that does anything.
 
This confuses me. A lot.

I'm pretty sure the mesh isn't the problem. Tried it with zaro's grass mesh and still the same problem.

Why the hell is it on only one side nearly totally see-through? It works close to perfectly on the other side. I don't get it. When I get back I'll try turning the different sides of the grass so they're not exactly on the same location... I just don't get it.

I've thought of this before, maybe is has something to do with the lighting? Depending on which direction the sunlight comes from, or something like that. It's pretty frustrating, though...
 
try enabling alpha testing in your material flags if you havent already, and if that doesn't work trying making an only black or white aplha texture avoiding greys.
 
Looking at native's grass texture you are right, the alpha channel has to be nearly only black&white. This sucks because my grass has smaller blades than natives'. Looks like I've either got to increase the resolution or stick to some very ugly aliasing.

Thanks for the help, people.
 
I had a "floral" problem problem pretty similar. In my mod I remade the map trees as asteroids, with their own texturwe and material. But, when I fired up the game and went charging into the asteroid belt, they were half transparent and half leaves. Heh. Anyways, aparrently its hardcoded to use the native map tree material, so I had to change the material to reference my new texture. So if you made a new grass texture, but didn't use the same name as the native grass texture, that could be the problem. If not, ah well, just needed to rant about my tumbleweed asteroids.
 
Yeah, it's just a very common problem with alpha blending, it's a matter of sorting. A lot of engines have this.
So there are two ways to "fix" it.
Either you keep on using alpha blending and modify your alpha channel to make it almost black and white, reducing the area where the sorting issue is visible.
Or you use alpha testing which will basically act like if you alpha channel was 1 bit. The downside of this is that you'll see hard edges, the advantage is that it's way more efficient performance wise and you'll never have any sorting issue with it.
If you make an alpha tested texture high-res, it might look better and be more efficient than using blending on smaller blended textures. It'll take more video memory space but since blending might be a pretty heavy process (depending on how it's implemented), it might be more interesting. Especially for something you see so often on screen.
 
gutekfiutek said:
Use 1 bit alpha for grass  - DXT1 ARGB (in .dds settings.)
It's more eficient - and removes this bug

Nope, doesn't work.

@Madawg:
Less performance needing grass actually sounds pretty neat. Grass is quite a performance hog in M&B. Like you said, grass is something the player gets to see very often so it may have a bigger texture. On top of that many video cards have 256mb or more so there really should be place enough.
You mean smoothing isn't possible by 'seeing hard edges', right?
However, the grass material is already flagged with 'Alpha testing'.

@GetAssista:
Humm, the bad thing is I can't check or uncheck material flags in BRFedit because parts of the interface block the checkboxes  :???:
 
Soil said:
However, the grass material is already flagged with 'Alpha testing'.

@GetAssista:
Humm, the bad thing is I can't check or uncheck material flags in BRFedit because parts of the interface block the checkboxes  :???:
How do you know alpha testing is checked then?  :lol:
Well, you can try it on a different pc, or even better, do it in hex editor. Flags area is right after the name of the material and before shader name afair, it's all straightforward there
 
GetAssista said:
Soil said:
However, the grass material is already flagged with 'Alpha testing'.

@GetAssista:
Humm, the bad thing is I can't check or uncheck material flags in BRFedit because parts of the interface block the checkboxes  :???:
How do you know alpha testing is checked then?  :lol:
Well, you can try it on a different pc, or even better, do it in hex editor. Flags area is right after the name of the material and before shader name afair, it's all straightforward there

Oh well, when I select a mesh I can see the material flag checkboxes, but only when I can't check them. When I change to the material tab(within the mesh tab) they get covered again :lol:

Alright, I will try the hex editing then. I guess the flags are 1/0 in the order they are in BRFedit?
 
you are trying to edit the materials incorrectly, there should be 5 tabs at the top, "mesh,mat,tex,col,skel,shader"
you should be using the mat tab there. if no materials show up there than there are no materials in your current brf file, materials can be cross referenced from different brf files so the material may be in another brf.

when changing tags from the real material tab there is a glitch where check-marking the box will not apply the tag so you must-

check the tag, the numbers above the tags will change accordingly, copy these, refresh, you will notice the numbers will reset and so will the tags, paste number you copied back into the box, click set, and now it will stay.
(you can only check one tag at a time this way, or you can take the tag #'s from another material which is faster)

the 2 that say "mesh,mat" and only appear on the mesh tab, cant be used to edit the material you can only change what material is currently applied and look at the properties of the current material.

 
I've been editing them in the real material tab all the time, however the checkboxes are covered over there too. They're only visible in the unclickable mesh-material tab.

I didn't know about that glitch though... Hmm, do I actually have to click on the checkboxes to make the numbers appear or does clicking somewhere on the name work as well?

Oh and... I should uncheck the 'Alpha Testing 1' flag, right?
 
Back
Top Bottom