Magic Library - True Type windows font
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
actually there is no problem to send the source of Magic2d library,but
i am thinking in converting it from a static library to a DLL library,just
like the Irrlicht DLL,so the problems of linking will be vanish.
i will post the DLL sooner.
i am thinking in converting it from a static library to a DLL library,just
like the Irrlicht DLL,so the problems of linking will be vanish.
i will post the DLL sooner.
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
Hi krama757
i wish i could offer some ideas,but i do not know any thing about shaders.
BTW what do you need or what do you want to do with multi-pass, we
may do it without Shaders.
i wish i could offer some ideas,but i do not know any thing about shaders.
BTW what do you need or what do you want to do with multi-pass, we
may do it without Shaders.
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
I haven't really used the magic 2d library, but to make it more portable, you might want to get rid of those window specific 'GetTickCount()' calls.
You can do the exact same thing, portably, by using Irrlicht's own built in timer.
You'd still have to work out where you get the device pointer in the design of your library, but at least it's portable to linux.
If you don't mind, I've ported some of your code off the wiki to Lua (CAnimSprite.cpp). It works nicely in Lua. Lua doesn't have 'GetTickCount()' so I had use Irrlicht's timer.
You can do the exact same thing, portably, by using Irrlicht's own built in timer.
Code: Select all
u32 time = device->getTimer()->getRealTime(); // 'GetTickCount()'
You'd still have to work out where you get the device pointer in the design of your library, but at least it's portable to linux.
If you don't mind, I've ported some of your code off the wiki to Lua (CAnimSprite.cpp). It works nicely in Lua. Lua doesn't have 'GetTickCount()' so I had use Irrlicht's timer.
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
thanks zenaku for your advices.
go a head and do what you want with the WIKI tutrorials.
go a head and do what you want with the WIKI tutrorials.
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
Hi All
here is a DLL of Magic2d Library,hope that it will end the Problems of linking.
download it from here
http://bcxdx.spoilerspace.com/BCXGL/Dll ... ibrary.zip
Enjoy it.
here is a DLL of Magic2d Library,hope that it will end the Problems of linking.
download it from here
http://bcxdx.spoilerspace.com/BCXGL/Dll ... ibrary.zip
Enjoy it.
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
Hello Emil. Using the multi pass shaders I am trying to get some nice looking grass on. Recently I gave up on that idea because multiple passes on the terrain means rendering all the polys 10 times and that will destroy the frame rate.Emil_halim wrote:Hi krama757
i wish i could offer some ideas,but i do not know any thing about shaders.
BTW what do you need or what do you want to do with multi-pass, we
may do it without Shaders.
So now I am trying to just render some formation of triangles with a alpha texture on them so that they may look like grass. My first test results looked nothing like grass because my textures and the formation of triangles I use were useless. Ill keep refining those.
By any chance do you have any ideas on this subject?
ok i have got the ultimate solution.
here we go
first we take each two vertices in a mesh
*--------*
1 2
we get their normals(!= normals)
! !
! !
*--------*
1 2
we use the normals as vectors then we transform the coordinate of vert 1 and two(not the vertices but a copy of their positions) using a matrix sutup using the vector. we translate by a defined amount.
we create vertices in the new pos
3 4
* *
*--------*
1 2
we join them on to create a quad
3 4
*--------*
[ quad ]
*--------*
1 2
you see that quad would be where the grass texure goes therfore automatically generated grass that sticks out
you can shake the grass using a texcoord and sine wave shader
here is the transform bit
m.setRotationDegrees(NORMAL);
m.transformVect(grass height);
core::vector3df LEFTPOINT=node->getAbsolutePosition() + grass height;
here we go
first we take each two vertices in a mesh
*--------*
1 2
we get their normals(!= normals)
! !
! !
*--------*
1 2
we use the normals as vectors then we transform the coordinate of vert 1 and two(not the vertices but a copy of their positions) using a matrix sutup using the vector. we translate by a defined amount.
we create vertices in the new pos
3 4
* *
*--------*
1 2
we join them on to create a quad
3 4
*--------*
[ quad ]
*--------*
1 2
you see that quad would be where the grass texure goes therfore automatically generated grass that sticks out
you can shake the grass using a texcoord and sine wave shader
here is the transform bit
m.setRotationDegrees(NORMAL);
m.transformVect(grass height);
core::vector3df LEFTPOINT=node->getAbsolutePosition() + grass height;
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
@omaremad_
i do not get your idea could you make a diagram that explain your idea.
@krama757
could you tell me what you want in the first pass ,and what is the next step
will do.
so what is that grass looks like could you post an image of it please.
i do not get your idea could you make a diagram that explain your idea.
@krama757
could you tell me what you want in the first pass ,and what is the next step
will do.
so what is that grass looks like could you post an image of it please.
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
Omaremand, thats a good idea and exactly what the billboard method mimics.
Your solution however will still require the same or more # of quads than a billboarding solution.
======
Emil, what the shader does is to first take a perlin noise map (black dots on a white background).
Then anyplace there is a black dot it draws a black dot on the landscape every pass with a little bit of height.
So, if you stick with the cool ascii art:
o <- thats a black dot on the texture of the landscape
o
o <- thats after the first pass...the black dot is translated a bit up and rendered again (in green ofcourse)
o
o
o <- 2nd pass and so on
Every pass the dot becoms a little bit smaller like a blade of grass tapering down to its tip.
Thats pretty much what the shader does.
=========
The grass looks like:
in rendermonkey.
Your solution however will still require the same or more # of quads than a billboarding solution.
======
Emil, what the shader does is to first take a perlin noise map (black dots on a white background).
Then anyplace there is a black dot it draws a black dot on the landscape every pass with a little bit of height.
So, if you stick with the cool ascii art:
o <- thats a black dot on the texture of the landscape
o
o <- thats after the first pass...the black dot is translated a bit up and rendered again (in green ofcourse)
o
o
o <- 2nd pass and so on
Every pass the dot becoms a little bit smaller like a blade of grass tapering down to its tip.
Thats pretty much what the shader does.
=========
The grass looks like:
in rendermonkey.
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
Im my own opinion, i think the cone primitive is the best mesh which
represent the grass branch.so you could model it as a 3ds.
for the sake of reality,you could reshape the circle base of the cone,
so that it looks like as ellipse shap.
apply a green texture for that cone,and load it one and draw it many times, as many as your card can do.
you could lock the mesh buffer for animate the cone,apply sin wave on
vertices of the cone, and so on....
each triangle of cone has a normal vector for lighting stuff,so create your
dinamic light for shadow of grass.
so what do you think,espcially there is no Multi-pass needed here.
represent the grass branch.so you could model it as a 3ds.
for the sake of reality,you could reshape the circle base of the cone,
so that it looks like as ellipse shap.
apply a green texture for that cone,and load it one and draw it many times, as many as your card can do.
you could lock the mesh buffer for animate the cone,apply sin wave on
vertices of the cone, and so on....
each triangle of cone has a normal vector for lighting stuff,so create your
dinamic light for shadow of grass.
so what do you think,espcially there is no Multi-pass needed here.
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
yes ,it is a huge triangles,but ....
4 monthes ago or more,someone release a tutorial that the same as your case,i do not remmber it but it has a huge billboards which represent tree and it only renders the groups of billboards those in front of camera and with a limited distance from the camra.
this way we can reduce the numbers of Polys and so on....
4 monthes ago or more,someone release a tutorial that the same as your case,i do not remmber it but it has a huge billboards which represent tree and it only renders the groups of billboards those in front of camera and with a limited distance from the camra.
this way we can reduce the numbers of Polys and so on....
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/