Horde3D

Next-Generation Graphics Engine
It is currently 28.03.2024, 10:50

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: 02.11.2009, 20:50 
Offline

Joined: 23.10.2009, 19:35
Posts: 23
I'm wondering if there are any plans of extracting color values from effect's in collada files (in colladaconv), for example the values for ambient, diffuse, etc?
If not, is there any interest in getting the code for doing this? (I have done this for diffuse.) .... I'm guessing the problem would be how to write out these to the material file...


Top
 Profile  
Reply with quote  
PostPosted: 02.11.2009, 22:14 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
EsaK wrote:
I'm wondering if there are any plans of extracting color values from effect's in collada files (in colladaconv), for example the values for ambient, diffuse, etc?
If not, is there any interest in getting the code for doing this? (I have done this for diffuse.) .... I'm guessing the problem would be how to write out these to the material file...
The bigger issue is that the standard shaders have no concept of ambient/diffuse/specular colour inputs, as these are much more often supplied by textures.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
PostPosted: 03.11.2009, 08:47 
Offline

Joined: 23.10.2009, 19:35
Posts: 23
I'll rephrase my question: Are there any plans to develop colladaconv further?
My problem is that if I make local changes to my copy (handling diffuse/ambient colors) and then a new version of colladaconv is released I will loose my changes (if I don't reintegrate them into the new codebase).
Any thoughts of how this could be handled (or maybe I'll just have to face the fact that there is no solution to this)?


Top
 Profile  
Reply with quote  
PostPosted: 03.11.2009, 09:01 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Maybe we could add some shader code and define flags that support ambient/diffuse/specular colour inputs. Although I think that most of the time textured objects are used, it may be good to have this possibility anyway, so that people who try to export non textured objects don't are confused because they got no rendering output.

So if you can provide a patch to the collada converter with your changes, we can try to integrate it, and maybe someone find the time to add ambient and specular colour support.


Top
 Profile  
Reply with quote  
PostPosted: 08.11.2009, 21:17 
Offline

Joined: 23.10.2009, 19:35
Posts: 23
Should I attach the changed files here (just 2 files) or upload them to the SVN trunk?


Top
 Profile  
Reply with quote  
PostPosted: 08.11.2009, 22:29 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
I would propose to post the files or a patch here.


Top
 Profile  
Reply with quote  
PostPosted: 08.11.2009, 23:21 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Shader flags have to be handled with care, else we can quickly run into the common and serious problem of "permutation explosion" where you get thousands of combinations or even a lot more. I would advise against adding a new flag for color values. Instead, I would suggest to add a diffuse multiplier which always modulates the diffuse texture. If no texture is desired, a default white texture is used. To make this convenient, the shader system needs to be slightly extended so that default textures can be specified for samplers.


Top
 Profile  
Reply with quote  
PostPosted: 09.11.2009, 20:26 
Offline

Joined: 23.10.2009, 19:35
Posts: 23
I have attached the 2 files with the changes in the attached zip file.
The sections I have added in the code are commented with "Support for solid colors".
I'm not entire sure how you would like the colors to be written in the material file... now they are used with a new shader (not existing yet, hopefully someone can write this since I'm not so good with shaders).
Anyway, feel free to change the setup as you like.


Attachments:
ColladaConverter.zip [10.81 KiB]
Downloaded 713 times
Top
 Profile  
Reply with quote  
PostPosted: 12.11.2009, 01:01 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Thanks for the code. I will take a closer look at the weekend.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group