Magic Library - True Type windows font

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Emil_halim
Posts: 518
Joined: Tue Mar 29, 2005 9:02 pm
Location: Alex,Egypt
Contact:

Post by Emil_halim »

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.
krama757
Posts: 451
Joined: Sun Nov 06, 2005 12:07 am

Post by krama757 »

Emil by any chance do you use shaders for any of these great things you accomplish? We are trying to figure out how to do multi-pass shaders in the advanced help forum and would love any ideas you can offer.
Emil_halim
Posts: 518
Joined: Tue Mar 29, 2005 9:02 pm
Location: Alex,Egypt
Contact:

Post by Emil_halim »

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.
zenaku
Posts: 212
Joined: Tue Jun 07, 2005 11:23 pm

Post by zenaku »

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.

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.
Emil_halim
Posts: 518
Joined: Tue Mar 29, 2005 9:02 pm
Location: Alex,Egypt
Contact:

Post by Emil_halim »

thanks zenaku for your advices.

go a head and do what you want with the WIKI tutrorials.
Emil_halim
Posts: 518
Joined: Tue Mar 29, 2005 9:02 pm
Location: Alex,Egypt
Contact:

Post by Emil_halim »

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.
krama757
Posts: 451
Joined: Sun Nov 06, 2005 12:07 am

Post by krama757 »

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.
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.

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?
omaremad_

Post by omaremad_ »

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;
Guest

Post by Guest »

stupid forum ruined my ascii pics
Emil_halim
Posts: 518
Joined: Tue Mar 29, 2005 9:02 pm
Location: Alex,Egypt
Contact:

Post by Emil_halim »

@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.
krama757
Posts: 451
Joined: Sun Nov 06, 2005 12:07 am

Post by krama757 »

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:

Image

in rendermonkey.
Emil_halim
Posts: 518
Joined: Tue Mar 29, 2005 9:02 pm
Location: Alex,Egypt
Contact:

Post by Emil_halim »

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.
krama757
Posts: 451
Joined: Sun Nov 06, 2005 12:07 am

Post by krama757 »

True, but a cone? Thats a lot of polys.

The simplest code you can make is about 6 triangles I believe. 6 x 10000 is a lot of triangles! (Assuming 10000 blades of grass)
Emil_halim
Posts: 518
Joined: Tue Mar 29, 2005 9:02 pm
Location: Alex,Egypt
Contact:

Post by Emil_halim »

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....
Guest

Post by Guest »

the link is broken, I want to download it bad!!!!!
Post Reply