Hi all.
I have seen this video with blender:
http://www.youtube.com/watch?feature=player_embedded&v=rv24WsM2zaU#!
I think possibly we can add such a thing to our shaders too? If someone can give me a tip, so i'll try to make it.
Hi all.
I have seen this video with blender:
http://www.youtube.com/watch?feature=player_embedded&v=rv24WsM2zaU#!
It’s already implemented in Terrain materials, doesn’t it?
There is a more sophisticated way of doing that presented in this short UDK tutorial:
Vertex Painting in UDK
I implemented that version in blender and extended the lighting material to support it.
This is how it looks in blender:
What’s the problem with using the terrain material?
I did not get the shader from blender to jme, I just implemented the same transformation so the result is the same.
The terrain shader does not use vertex colors so I don’t know how to get the same blending effect using just alpha maps and tiling textures.
Using vertex colors let you more control of the blending.
@remorhaz Your shader is really cool! But i did not find the difference between BlendFactor=10 and BlendFactor=0.1. Material looks the same.
Can I add your shader to ShaderBlow Project? http://code.google.com/p/jme-glsl-shaders/downloads/list
If you want I can add you there as a developer.
Also it’s interesting is it possible to combine textures with textureArray?
@remorhaz I also found a bug in your fragment shader:
[java]bc = pow(bc,10); // original
bc = pow(bc,10.0); // should be
[/java]
Some ATI card cannot compile it. If you use float, so it would be better to write 10.0, 2.0… It’s GLSL .
Opps, the second parameter to pow should be the material input parameter BlendFactor and not the constant 10, I forgot to change it back after some testing, thanks for finding it. This is just a proof of concept implementation and made only a couple of happy pass testing. I am experimenting with color management too so the fragment shader now converts sRGB to linear and back. I just uploaded the whole stuff as it is, sharing was not in my mind yet , but feel free to change anything and use it if you like.
Ok, I get you.
What the problem with sRGB and Linear RGB? Why do you make conversions?
When I examined blender’s glsl shaders I found that they do that, then I started to google and I found this article from GPU Gems 3:
Chapter 24. The Importance of Being Linear
This explains it better than I could.
Also for additional info and the math this wikipedia entry comes handy:
http://en.wikipedia.org/wiki/SRGB
Since I use GIMP for creating the textures and GIMP’s default colorspace is sRGB (so my textures are sRGB) I thought I give it a try and see if it makes any difference if I make the conversions in the lighting shader and it seems it does, at least I like it better.
Since opengl 3 there is srgb texture and framebuffer support as more recent GPUs support it on the hardware level.
Wow! it’s interesting. Can you show your tests screenshot with difference of modele lighting?
@Momoko_Fan , @nehon , what do you think about it? Possibly it will be cool for Lighting shader?
@mifth said:
Wow! it's interesting. Can you show your tests screenshot with difference of modele lighting?
@Momoko_Fan , @nehon , what do you think about it? Possibly it will be cool for Lighting shader?
@Momoko_Fan said:
There's not much point, given that it is already supported by the terrain material.
@Momoko_Fan said:
There's not much point, given that it is already supported by the terrain material.
sRGB colorspace is a different thing. I thought were were just discussing texture blending with vertex colors? I understand there’s a difference but really how hard is it to use a stencil texture in Blender instead of vertex color for blending? In fact texture painting gives you more accuracy than vertex color, especially in your example that uses quads.
@remorhaz can you make a test with s sphere instead of plane? And one light source.
@Momoko_Fan said:
sRGB colorspace is a different thing. I thought were were just discussing texture blending with vertex colors? I understand there's a difference but really how hard is it to use a stencil texture in Blender instead of vertex color for blending? In fact texture painting gives you more accuracy than vertex color, especially in your example that uses quads.
@mifth said:
@remorhaz can you make a test with s sphere instead of plane? And one light source.