www.quadsoftware.com
FAQ  FAQ   Search  Search   Memberlist  Memberlist   Usergroups  Usergroups
Register  ::  Log in Log in to check your private messages


Post new topic  Reply to topic
 Objects with alpha « View previous topic :: View next topic » 
Author Message
Jaggedge
PostPosted: Thu Nov 06, 2008 10:08 am    Post subject: Objects with alpha Reply with quote



Joined: 08 Jul 2008
Posts: 56

Hi, I used to be able to bring in my own objects ( using collada ) into Grome and have Grome recognise my alpha textures by selecting the correct material. I can't seem to do this now.

How do I use my own models with alpha texture?
Back to top
View user's profile Send private message
ALicu
PostPosted: Thu Nov 06, 2008 7:29 pm    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Hello, what were the steps you were doing to assign the alpha materials to the objects? Future Grome build will allow you to individually assign per instance materials and textures. From what I know there is no way to assign custom materials for 3rd party formats (like COLLADA is) (or you can assign the material but the assignment is lost once the scene is saved). Let me know what steps you were using maybe we can find a solution.

Regards,
Adrian L.
Back to top
View user's profile Send private message
Jaggedge
PostPosted: Fri Nov 07, 2008 6:45 am    Post subject: Reply with quote



Joined: 08 Jul 2008
Posts: 56

Yes I recall that the assignment would be lost once the scene was saved, which is something that I am prepared to live with, for the moment. As long as I could have an accurate representation of my models when i sculpt my terrain.

This is how I used to do it:

1. Export my model from MAX to Collada ( *.dae ) format.
2. Add the export directory as a Favorite in Grome's PackageBrowser
3. Select the model, eg. Tree.dae, right-click on icon and select Load
4. Right-click again and select Edit
5. Select "Surface 1" and change the Material option on the right to the desired alpha material.

In the latest version, I can't seem to execute the last step. The "Material" option is greyed out.
Back to top
View user's profile Send private message
Jaggedge
PostPosted: Fri Nov 07, 2008 7:53 am    Post subject: Reply with quote



Joined: 08 Jul 2008
Posts: 56

I vaguely remember someone suggesting that Grome could automatically detect that the texture in the *.dae object contains alpha, and assign the correct material to it. Perhaps that could be a start?
Back to top
View user's profile Send private message
ALicu
PostPosted: Fri Nov 07, 2008 9:41 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Oh, yes you are right, we've disabled that feature since it caused some bugs in some situations. The good news is that I've modified the COLLADA storage plugin so based on the material name it assigns an alpha test shader or not. You can get the new plugin from here:

http://www.quadsoftware.com/storage/ColladaStorage.rar

Just unpack this in the plugins Grome folder overwriting the old one.

This automatic material assignment works as follows: give your object a material containing one of the following words "alpha", "transparent" or "transparency". It can start with capital letter (followed by all lower case) and it can contain any other words (example: "MyMaterial-alpha", "SomeTransparentShader"). So, in 3DS Max, Maya, or whatever application you are exporting the collada file from, assign a material with this naming convention. Then when the template is loaded, the grome plugin will assign alpha testing material if the above mentioned conditions are met. Also if you want your object to not be lit (using vertex lighting) you can also include "nolight" in the material name (Example: "transparent-nolight" for an alpha test no lit object).

To make sure your collada file meets this requirement, open the .dae file and look into two places where the material name appears:

1. first search "triangles". You should have something like:

<triangles count="26952" material="Alpha-Material1">

2. Then the same material name (Alpha-Material1 in this case) should appear by the end of the file at the instance_material tag:

<instance_material symbol="Alpha-Material1" target="#ID3">

Let me know if this fixes your problem. I think this is the best solution, using a naming convention to automatically assign materials. There are no other reliable collada specific elements I can use for this detection.

Regards,
Adrian L.
Back to top
View user's profile Send private message
ALicu
PostPosted: Mon Nov 10, 2008 8:31 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

I've posted an update to the plugin (use the same link in the above post). This fixes a bug and also added support for alpha blend (not just alpha test). So if you also use "blend" word in the material name, alpha blend is used. Be aware that alpha blended objects are rendered last without any depth test (so they are suitable for transparent objects like water surfaces).

So here are the rules:

"alpha", "transparent", "transparency" -> alpha test (material: AlphaTest). Example: "somematerialwithalpha"

above + "blend" -> alpha blend (material: AlphaBlend-NoDepth). Example: "my material-alpha-blend"

any of the above + "nolight" -> no lighting used (AlphaTest-NoLight or AlphaBlend-NoDepth-NoLight). Example: "material-alpha-blend-nolight".

All materials are in Library/Materials and can be further edited.

Regards,
Adrian L.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

Jump to:  



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 vote in polls in this forum


Based on a template by Dustin Baccetti
Powered by phpBB © 2001, 2005 phpBB Group