Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: SetVertex -> Cannot set color?  (Read 5291 times)
regress
Customers
Community Member
*****
Posts: 241


« on: January 08, 2003, 07:15:18 PM »

Passing the color argument when using SetVertex on a mesh appears to do nothing. No matter what color I pass, all vertexes remain white.

Cheers,
Ben
Logged
JohnnyC
Community Member
*
Posts: 1488


WWW
« Reply #1 on: January 08, 2003, 07:16:06 PM »

Was fixed today Tongue
Logged

_________________

John Chewter
Keyne Image
www.keyneimage.co.uk
regress
Customers
Community Member
*****
Posts: 241


« Reply #2 on: January 08, 2003, 07:28:11 PM »

Right on.  Here's a associated question: Would it be a possible to also add an optional argument to the SetColor call, or alternately, a SetVertexColor call, which allows one to set color by vertex (pass vertex ID) as well? If it's no big deal to add it, it would help me out tremendously, e.g. I'd be able to change the color of a vertex at any time.

Cheers,
Ben
Logged
JohnnyC
Community Member
*
Posts: 1488


WWW
« Reply #3 on: January 08, 2003, 07:30:31 PM »

No idea - i just park the cars and sell popcorn...... ask 'The Code God'
Logged

_________________

John Chewter
Keyne Image
www.keyneimage.co.uk
Dreddnafious
Community Member
*
Posts: 24


« Reply #4 on: January 08, 2003, 08:01:43 PM »

ummm Johhny, i said extra butter and no salt, not extra salt and no butter.
and 40 quid was missing from my car's console. Im afraid im going to have to speak to your boss about this...  Cheesy
Logged
JohnnyC
Community Member
*
Posts: 1488


WWW
« Reply #5 on: January 08, 2003, 08:04:24 PM »

Yeah but I got a tight butt and look cool in these skates so f... mat your hard disk buddy Tongue
Logged

_________________

John Chewter
Keyne Image
www.keyneimage.co.uk
Dreddnafious
Community Member
*
Posts: 24


« Reply #6 on: January 08, 2003, 09:06:27 PM »

bragger  :lol:
Logged
SylvainTV
Administrator
Community Member
*****
Posts: 4479


WWW
« Reply #7 on: January 09, 2003, 07:24:12 AM »

Regress, now the TVMesh doesn't support any more  a color/vertex, it caused too much overhead in the code to support and wasn't flexible really. So that's why you can use only SetColor/SetMaterial to set the color on meshs.

Hmm maybe there is a workaround though, what were you trying to do?
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 !
regress
Customers
Community Member
*****
Posts: 241


« Reply #8 on: January 09, 2003, 11:02:04 AM »

I'm working on my TreeFactory code again; I can still change color, given a fairly generic bark texture, of a given tree (each tree is one mesh group) using SetMaterial, but setting color on individual vertexes would be helpful for:

- easily "darkening" the tops and bottoms of trunks and branchs
- changing color/alpha to different levels of transparency at vertexes which hinder the camera perspective (can do it with the whole tree itself I believe with SetMaterial, but haven't tried that yet)
- since individual mesh groups in one mesh cannot take advantage of the shadow functionality you've built into the TVMesh object, having per-vertex color operations would also help with creating gradient home-grown shadows for the trees

Cheers,
Ben
Logged
shellshock
Customers
Community Member
*****
Posts: 117


« Reply #9 on: January 10, 2003, 01:13:17 PM »

Sylvain,
Quote
now the TVMesh doesn't support any more a color/vertex, it caused too much overhead in the code to support and wasn't flexible really.

If the TVMesh no longer supports color veritces, I would recommend removing the color args from the addvertex method.  It is confusing to have a required arguement that does nothing.

I also have been using colored vertices in a couple of RC2 apps, primarily with multi-colored line strips, and some meshes with Tristrips that are vertex colored as opposed to textured.  Unlike regress, I am not trying to  change the vertex colors dynamically, just set them when I add the vertex.  Since the color of the vertex is determined by a number of factors at the time it is added, it is impossible to "Pre-create" a texture.  I am essentially using the line strip to provided quick visual analysis of events in an entities history (Engine on = color_1, coast = color_2, detected by sensor = color_3, Targetted by missile = color_4, etc).  In this manner, I can look at the history trail any element and quickly determine if it is behaving appropriately, or if I have a problem in my simulation, without digging into the binary results data.
I know that I can add a new mesh with the approptiate color for each line segment, but this gets really ugly( and slow) when I have 1000 entities in my simulation.
I know that there was some overhead, but the functionality that you had in RC2 was really working well for me.  Any idea for a work around would be greatly appreciated.
Logged
shellshock
Customers
Community Member
*****
Posts: 117


« Reply #10 on: January 10, 2003, 01:16:51 PM »

@JohnnyC
Quote
Was fixed today

Vertex color setting is fixed, or unused vertex color args removed?
Sylv seemed to indicate that the ability to set vertex colors had been intentionally removed.
Logged
regress
Customers
Community Member
*****
Posts: 241


« Reply #11 on: January 20, 2003, 10:19:37 AM »

bump... any suggestions/clarifications?

cheers,
ben
Logged
shellshock
Customers
Community Member
*****
Posts: 117


« Reply #12 on: January 27, 2003, 01:02:43 PM »

bump
Logged
regress
Customers
Community Member
*****
Posts: 241


« Reply #13 on: January 31, 2003, 09:26:08 PM »

bumpidy-bump
Logged
Zaknafein
Customers
Community Member
*****
Posts: 2674


WWW
« Reply #14 on: February 05, 2007, 01:50:46 AM »

Is this still true? I find it pretty limitative, I wanted to implement precomputed ambient occlusion into the vertex color channel and I just cannot set it with SetVertex. At least I don't get any effect.

Is there any workaround? I tried writing to tu2/vu2 and didn't get any more success, accessing it with the TEXCOORD1 set has blank (1, 1) values everytime.

Edit : Oops, didn't see this was in the 6.2 section. I'm having this problem in 6.5.
Logged

zaknafein.
>> the instruction limit : my blog & samples repository! <<
Hypnotron
Customers
Community Member
*****
Posts: 820


« Reply #15 on: February 05, 2007, 01:55:51 AM »

You can successfully set the vertex color in 6.5 using a custom mesh vertex format.  I've done it and it works.
Logged
Zaknafein
Customers
Community Member
*****
Posts: 2674


WWW
« Reply #16 on: February 06, 2007, 03:35:41 AM »

Indeed it does. Smiley
Just had to set the right mesh format... hehe.
Logged

zaknafein.
>> the instruction limit : my blog & samples repository! <<
DanDixon
Customers
Community Member
*****
Posts: 181


« Reply #17 on: March 08, 2008, 11:47:12 PM »

In 6.5 the right mesh format is (where theMesh is a TVMesh):
Code:
theMesh.SetMeshFormat CONST_TV_MESHFORMAT.TV_MESHFORMAT_DIFFUSE + CONST_TV_MESHFORMAT.TV_MESHFORMAT_NOLIGHTING

Related info here:
http://www.truevision3d.com/forums/tv3d_sdk_65/mesh_setcolor-t15694.0.html
Logged
jviper
Community Member
*
Posts: 1382

Discipline in training


« Reply #18 on: March 10, 2008, 09:00:00 AM »

I can't see the code. The scroll bar is in the way. Hey uh that may have to be fixed because I notice that happening often when posting code.

So anyway....the other option ofourse would be simply to use a custom shader.
Logged

JAbstract.....Don't just imagine, make it happen!
Pages: [1]
  Print  
 
Jump to:  

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