Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Vertex color crushed uv coordinates

Author
Message
Kuper
18
Years of Service
User Offline
Joined: 25th Feb 2008
Playing: Planescape:Torment
Posted: 19th Nov 2011 13:05
Hi! I get this problem when export model with colored vertexes from 3ds max and then set parallax mapping shader on it.In shader i use float3 Normal:NORMAL; float3 Tangent:TANGENT; float3 Binormal:BINORMAL; commands and this crushed model uv coordinates.Without using this commmands there is no problems. Is it possible to use vertex color and normal-tangent-binormal data together? Simple project and shader attached. Thanks
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Nov 2011 17:45 Edited at: 19th Nov 2011 18:06
This problem has been around for a while and I don't understand why. It is very annoying.

Since your shader doesn't use the vertex colour one possible solution is to remove the unused vertex colour from the object like this:



If you need the vertex colour then a possible work-around (untested ) would be to copy the vertex diffuse values into two new UV stages, then delete the vertex diffuse from the fvf. The shader could then reconstruct the colour from the two new sets of UV data.

Edit Thought I'd put my money where my mouth is.

Here's a screenshot using the method I just suggested:



Revised project attached to next post.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Nov 2011 18:08
Revised project (WITHOUT the exe!!!) attached.
Kuper
18
Years of Service
User Offline
Joined: 25th Feb 2008
Playing: Planescape:Torment
Posted: 19th Nov 2011 18:34
I also thought about this )) And seems it is the only way to make it work. But i cant understand if it is DBPro bug or i do something wrong. Maybe i should convert object to some special fvf format to use both normal and uv data? However your code works well/Thanks alot))
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Nov 2011 01:00
Quote: "But i cant understand if it is DBPro bug or i do something wrong."


It's a DBPro bug.

Quote: "Maybe i should convert object to some special fvf format to use both normal and uv data?"


I assumed your object already had those - didn't check that. You can check for yourself using the make memblock from mesh and make mesh from object commands.

Login to post a reply

Server time is: 2026-07-10 01:58:34
Your offset time is: 2026-07-10 01:58:34