LightMesh is Slow?
Blitz3D Forums/Blitz3D Programming/LightMesh is Slow?
| ||
Hello, i am using lightmesh to adjust the ilumination of my models to the lightmaps. The problem is that i am having several drops of fps when lightmeshing 4 or more models. Is this command so slow? |
| ||
Yes. The command will be slow as it is doing the equivalent of: <calculate light> For sf=1 to countsurfaces(mesh) Surf=getsurface(mesh,sf) for vt=0 to countvertices(surf)-1 vertexcolor..... next next :( Theres alot of stuff thats slow. Hideentity is slow dispite the apparent speed up a few years back, Blitz Animation would be so much faster with a few optimisations here and there :/ Anyway, I digress... Yes. Lightmesh is slow :( |
| ||
Ohhh, accesing every vertex!!! So it needs the vertex color flag. Very bad news then... By the way, Cygnus, thanks, you are responding all my posts! P.D: Are there any list of commands that are slower than they should? |
| ||
Ok, so, any other way to change the ilumination of a mesh to get affected by the lightmap? |
| ||
I simply darken the entire mesh if it enters a shaded area (entitycolor). Tracer |
| ||
mmm, but entitycolor use the vertexcolor? can i use entitycolor if the mesh is textured? I need to try that... |
| ||
Are there any list of commands that are slower than they should? Hideentity seems to struggle with animated meshes, though animation its self is slow. actual PICKing commands, Anyting that will modify an entire mesh at vertex level (mesh commands not entity); slow I *think*. 2D=SLOWW. lol Theres Plenty of stuff about it lying around here.. Entitycolor is plenty fast for this use, and you can use it with a textured mesh, too. [edit] Oh, and no problem :) Community helps me, I help the community. :D |
| ||
I change EntityColor with a textured mesh but doesn't seem to work... need to be active vertex colors??? |
| ||
Hmm, there are entityFX flags you may want to play with, i dont remember the values there but the Vertex Colours flag may need Playing with :) Best thing mate, just play around :D |
| ||
i dont get entitycolor to work with anim meshs. any hints? |
| ||
Not sure but perhaps you will need to search the child you want to change the color. Or if you want to change the entire mesh do it recursively through the hierarchy with countchildren and getchild. |
| ||
t3K - use this: http://www.blitzbasic.com/codearcs/codearcs.php?code=1170 KuRiX: EntityColor should work with textured meshes. The default color is 255,255,255. Maybe you need to use EntityFX to allow this. If it is a B3D Mesh and Vertex Color is "disabled" in the Mesh File, you maybe not gonna be able to override it with EntityFX, instead make sure to save the B3D File with other settings. |
| ||
Yes, i solved this long time ago, but forgot to answer here xD thanks anyway! |
| ||
thanks jfk. now its working - but now i know why its so slow ;) |