Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Semantic Requests  (Read 2314 times)
AriusEso
Customers
Community Member
*****
Posts: 940

Esoteric


« on: February 23, 2009, 07:36:11 AM »

I need the following please if at all possible.

MINIMESH_POSITION ( As in the mesh position, not the vertex position - like LIGHTPOSITION. MINIMESH_POSITION[Index] etc )
MINIMESH_BOUNDINGSPHERERADIUS ( I doubt it has boundings? )

If it has no boundings, please give us something like:

MINIMESH_CUSTOMFLOAT along with SetMiniMeshCustomFloat(float fCustom, int iMiniMeshID);

Thank you.
Logged

-...-

AriusEso
Customers
Community Member
*****
Posts: 940

Esoteric


« Reply #1 on: February 23, 2009, 09:16:47 AM »

I need these in order to use minimesh for lighting. I have prooven the theory by hard coding the values for 1 light( 1 minimesh element ).

Lookit: http://img7.imageshack.us/img7/9122/sucksballs.jpg

But I need a way to grab the position of each minimesh element within the shader, the custom float value would be the lights radius.
Logged

-...-

Lenn
Customers
Community Member
*****
Posts: 876

+/-


« Reply #2 on: February 23, 2009, 09:45:27 AM »

Maybe I'm misinformed, as I'm not a shader pro by ANY means but:
Doesn't supplying a semantic like you need do just about the same thing as if you were sending the variables by yourself to the shader using SendEffecParamSomething()? Is there a speed increase in the engine automaticaly sending the data VS you calculating it for each minimesh by yourself and sending it as some data format parameter? Because a float within a shader is a float regardless of how you send it, right?
Logged

TV3D 6.5 Community Docs - Read, use and please contribute!
AriusEso
Customers
Community Member
*****
Posts: 940

Esoteric


« Reply #3 on: February 23, 2009, 09:55:51 AM »

Maybe I'm misinformed, as I'm not a shader pro by ANY means but:
Doesn't supplying a semantic like you need do just about the same thing as if you were sending the variables by yourself to the shader using SendEffecParamSomething()? Is there a speed increase in the engine automaticaly sending the data VS you calculating it for each minimesh by yourself and sending it as some data format parameter? Because a float within a shader is a float regardless of how you send it, right?

The issue is that the minimesh shader is run for every element in the minimesh system when I call CTVMiniMesh->Render();. There is no way for me to send the value for each element individually. The only way this can be done is through a couple of semantics unfortunately. The positional one shouldn't be hard to add. The custom float, well, I think it would be useful to have some custom data for minimesh as at the moment it's hard to really add things. MINIMESH_CUSTOMFLOAT, MINIMESH_CUSTOMVEC3 and so on. But the float and position are really important to my project right now.
Logged

-...-

Lenn
Customers
Community Member
*****
Posts: 876

+/-


« Reply #4 on: February 23, 2009, 10:35:18 AM »

Oh, thats right, you call the shader for all the minimeshes at once. Rendering the minimeshes 1 by 1 would probably be pointless in terms of speed advantage. You're right, those semantics would be useful.
Logged

TV3D 6.5 Community Docs - Read, use and please contribute!
SylvainTV
Administrator
Community Member
*****
Posts: 4946


WWW
« Reply #5 on: February 23, 2009, 11:09:21 AM »

For the "position" you can directly use the elements from the matrix no?
It must be float3(mat[MinimeshID][0][3], mat[MinimeshID][1][3], mat[MinimeshID][2][3])

For the custom stuff it's a little annoying because there will be a shortage of constants in the VS.
Remember that we have already 52 * 3 consts used for matrices and 52 consts for colors. Only 256 constants are available Smiley
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
AriusEso
Customers
Community Member
*****
Posts: 940

Esoteric


« Reply #6 on: February 23, 2009, 11:14:04 AM »

For the "position" you can directly use the elements from the matrix no?
It must be float3(mat[MinimeshID][0][3], mat[MinimeshID][1][3], mat[MinimeshID][2][3])

For the custom stuff it's a little annoying because there will be a shortage of constants in the VS.
Remember that we have already 52 * 3 consts used for matrices and 52 consts for colors. Only 256 constants are available Smiley

Ahh of course. I never thought about that. As for the radius, I can do the same thing I think. Each one has a radius of "1" as default, then the scale determines. So I can grab the radius by getting the scale.

Thanks man.
Logged

-...-

AriusEso
Customers
Community Member
*****
Posts: 940

Esoteric


« Reply #7 on: February 24, 2009, 09:15:03 AM »

I was having trouble getting it working until ZaPP on IRC gave me a heads up. So, for anybody searching the forum who comes across this thread.

float3(m[3][0], m[3][1], m[3][2]);

NOT: float3(m[0][3], m[1][3], m[2][3]);
Logged

-...-

SylvainTV
Administrator
Community Member
*****
Posts: 4946


WWW
« Reply #8 on: February 24, 2009, 09:33:36 AM »

oops I had it right the first time, but I edited then to reverse the order :/ Sorry about that !
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks