realXtend / tundra

realXtend Tundra SDK, a 3D virtual world application platform.
www.realxtend.org
Apache License 2.0
84 stars 70 forks source link

Ogre Material parser logic should ignore comments #656

Open jonnenauha opened 11 years ago

jonnenauha commented 11 years ago

It seems that our Material parser logic does not ignore commented out lines when searching for things. Also OgreRenderer::ProcessMaterialForTextures is quite naive although fast implementation but can potentially pick up false results. Like one of my code places has a permanent ignore check for "src_current" returned from ProcessMaterialForTextures.

There has been also reports of other weird things in the OgreMaterialAsset parser that has hit something in the blender2ogre comment line at the top of the file.

pavlovski commented 10 years ago

@jonnenauha : I examined this issue and found that both "//" and "/* */" works ok. Also I've learned how material stuff works and it seems to me that ProcessMaterialFileForTextures, which holds a parsing logic, is never used. Do we need to include that, add something more or maybe it is already done on Ogre side?

jonnenauha commented 10 years ago

I wasnt reporting that having comments would break things. But if you have a comment // Here is the diffuse texture for pla pla pla, calling ProcessMaterialForTextures will simply report that there is a texture reference of for (as its preseded by texture) in the material. It should really check all texture units and parse the texture keyword from inside of it.

I cant remember where this src_current was picked up but had also something to do with the incredibly naive texture keywork iteration.

That being said the actual OgreMaterialAsset does not have these bugs, its only the ProcessMaterialForTextures function which as you said is not being used there.