I hope irrlicht will implement soon these features:
MeshBuffers and vertices that supports more than 2 textures and each textures with its own separate textures coordinates. (not really a flexible vertex format)
(if using less than or exactly 4 textures I think this will be always compatible with old hardware)
Thanks.
feature request: new mesh buffer and vertices
feature request: new mesh buffer and vertices
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Like I said in my other post, it can be done with Tangent vertices:
You can control these in a shader and map them to the correct texture-slot there too;
remember each material can have up to 4 textures assigned to it.
On older hardware, you can emulate the same setup in software although it wont be as fast or efficient.
The meshbuffer can also be recast to use Tangent vertices, see the iMeshBuffer implementation
It isn't worth adding a new vertex format and meshbuffer just because you need it for one specific project;
I am sure that is what the devs will say to you...
Code: Select all
Pos = vertex Pos X,Y,Z
Normal = vertex Normal X,Y,Z
UV 1 = vertex UV X,Y
UV 2 = vertex Binormal X,Y
UV 3 = vertex Tangent X,Y
UV 4 = vertex Binormal Z, vertex Tangent Z
remember each material can have up to 4 textures assigned to it.
On older hardware, you can emulate the same setup in software although it wont be as fast or efficient.
The meshbuffer can also be recast to use Tangent vertices, see the iMeshBuffer implementation
It isn't worth adding a new vertex format and meshbuffer just because you need it for one specific project;
I am sure that is what the devs will say to you...
Maybe you are a bit confused because of the data flow.
You need to setup your meshes first outside the shaders. That is a somewhat simple step, you apply the mapping coordinates you need in the order you need, after, what i do is to access the data in the vertex shader as the vectors they are suposed to be, but i translate them into float2 mapping coordinates and treat them like that in the Pixel shader
Watch this:
This is the input of the vertex shader:
That is the layout of the current S3DVertexTangent. Yep, tangent and binormals aren't placed where they should. Maybe this is why it is failing. And indeed, it is not documented. I found out this watching the normal mapping algorithm included in the engine. I think it should either be written somewhere, or even better, that the BINORMAL and TANGENT semantics were actually used.
this is the output of the vertex shader:
In the Vertex shader, for instance i do this....
And that way you can have multiple texture coordinates in your shaders. I think this could be used as a small snippet
You need to setup your meshes first outside the shaders. That is a somewhat simple step, you apply the mapping coordinates you need in the order you need, after, what i do is to access the data in the vertex shader as the vectors they are suposed to be, but i translate them into float2 mapping coordinates and treat them like that in the Pixel shader
Watch this:
This is the input of the vertex shader:
Code: Select all
struct{
float4 position:POSITION0;
float3 normal:NORMAL0;
float3 tangent:TEXCOORD1;
float3 binormal:TEXCOORD2;
float2 texCoord0:TEXCOORD0;
float4 color:COLOR0
};VS_INPUT
this is the output of the vertex shader:
Code: Select all
struct{
float4 position:POSITION0;
float2 texCoord0:TEXCOORD0;
float3 normal:TEXCOORD1;
float2 texCoord1:TEXCOORD2;
float2 texCoord2:TEXCOORD3;
float2 texCoord3:TEXCOORD4;
float4 color:TEXCOORD5
};PS_INPUT
Code: Select all
PS_INPUT vs_main(VS_INPUT IN){
PS_INPUT OUT;
OUT.Position... (whatever you want to put in the position...)
OUT.normal... (whatever you want to put in the normal...)
OUT.texCoord0 = IN.texCoord0;
OUT.texCoord1 = IN.tangent.xy;
OUT.texCoord2 = float2(IN.tangent.z,IN.binormal.x);
OUT.texCoord3 = IN.binormal.yz;
OUT.color = IN.color;
return OUT;
}
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
sure that's great. the thing i don't understand in shaders are infact output and input. the meshes were all correctly set up but shaders wasn't work. thanks a lot. this will be usefull also as tutorial about how to write shaders.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me