Shield Effects [OpenGL]

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Viz_Fuerte
Posts: 91
Joined: Sun Oct 19, 2008 5:29 pm
Location: Valencia (Spain)
Contact:

Post by Viz_Fuerte »

The code works, the only thing to do is change the index of the texture.

Change the index 1 and 2, to 0 and 1.
You can not add the layer you want.

ARB -> http://en.wikipedia.org/wiki/ARB_%28GPU ... anguage%29
freetimecoder
Posts: 226
Joined: Fri Aug 22, 2008 8:50 pm
Contact:

Post by freetimecoder »

Hm ok, then I have to reconstruct some code, since the original node has to really be invisible.

greetings
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

I don't know if you wanted this but I did it anyway because frankly changing the site from what you chose is worth anything!!

MIRRORED ON MEDIAFIRE
removed - old version
Last edited by Midnight on Tue May 25, 2010 10:24 am, edited 1 time in total.
trivtn
Posts: 132
Joined: Tue Jan 17, 2006 12:30 pm
Location: Viet Nam
Contact:

Post by trivtn »

Shader compile error :

Code: Select all

 0(1) : error C1115: unable to find compatible overloaded function "pow(float, int)"  
I've changed :
float intensity=1/pow(dist,2)*radius*0.01;
to :
float intensity=1/pow(dist,2.0)*radius*0.01;
It've worked perfect ! Thanks freetimecoder !
There's something is fantastic, there's nothing is absolute.
freetimecoder
Posts: 226
Joined: Fri Aug 22, 2008 8:50 pm
Contact:

Post by freetimecoder »

@trivtn: This is an old error, sorry forgot to edit the code in the first post.

@Midnight: You can upload it if you like, but you uploaded the older version.

I removed the old link in the first post now to prevent more confusion.

Sorry, I am a bit sloppy with version control in this thread :oops:
As soon as I finished including Viz_Fuerte's arb shader I will update all code and downloads to the newest version.

edit: done

greetings
Viz_Fuerte
Posts: 91
Joined: Sun Oct 19, 2008 5:29 pm
Location: Valencia (Spain)
Contact:

Post by Viz_Fuerte »

I say once again... :D I like this effect. :D

I tried again and perfect :wink:

PD: It seems that the "Simple but useful projects" are helpful :lol:

BYE!
freetimecoder
Posts: 226
Joined: Fri Aug 22, 2008 8:50 pm
Contact:

Post by freetimecoder »

They are very useful indeed :)

greetings
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

ill use it in my project, thanks :3
Image
Image
d3jake
Posts: 198
Joined: Sat Mar 22, 2008 7:49 pm
Location: United States of America

Post by d3jake »

This is certainly something that I'll be implementing as well.
The Open Descent Foundation is always looking for programmers! http://www.odf-online.org
"I'll find out if what I deleted was vital here shortly..." -d3jake
teto
Posts: 159
Joined: Thu Dec 03, 2009 9:37 pm
Location: /home
Contact:

Post by teto »

It finally works on my computer. That's great thx for the hard work.
Scarabol
Posts: 167
Joined: Sat Jan 03, 2009 5:26 pm
Location: Aachen, Germany

Post by Scarabol »

Yeah i like it! Looks great! Thx!

I'll use it in my projekt, too.

MfG
Scarabol
Irrlicht 1.7.2
Eclipse
Boost
Scarabol
Posts: 167
Joined: Sat Jan 03, 2009 5:26 pm
Location: Aachen, Germany

Post by Scarabol »

hm, i got an error:

Code: Select all

error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: bool __thiscall CShieldManager::removeShield(class irr::scene::ISceneNode *)" (?removeShield@CShieldManager@@QAE_NPAVISceneNode@scene@irr@@@Z)" in Funktion ""public: __thiscall star::spaceobject::~spaceobject(void)" (??1spaceobject@star@@QAE@XZ)".
I looked at CShieldManager.cpp and can't find removeshield() where is it?

MfG
Scarabol
Irrlicht 1.7.2
Eclipse
Boost
freetimecoder
Posts: 226
Joined: Fri Aug 22, 2008 8:50 pm
Contact:

Post by freetimecoder »

Uhm must have forgotten it :oops:

Add that to the CShieldManager.cpp:

Code: Select all

bool CShieldManager::removeShield(scene::ISceneNode *node){
    //Check if shield exists
    for(u32 i=0; i<array_Shields.size();i++){
	    if(array_Shields[i].shieldNode == node){
            //Erase all impacts of the shield
            while(!array_Shields[i].array_Impacts.empty()){
                array_Shields[i].array_Impacts.erase(0);
            }
	        array_Shields.erase(i);
	        return true;
	    }
    }
    return false;
}
greetings
Scarabol
Posts: 167
Joined: Sat Jan 03, 2009 5:26 pm
Location: Aachen, Germany

Post by Scarabol »

:lol: no problem

BUT
all the user here who wrote "works on my computer" "i tried an again and perfect" "the code works" ect. better use this 8)

MfG
Scarabol
Irrlicht 1.7.2
Eclipse
Boost
Scarabol
Posts: 167
Joined: Sat Jan 03, 2009 5:26 pm
Location: Aachen, Germany

Post by Scarabol »

Hi,

did you check your program with another video driver?

Im using Directx9 and i cant see any shield.

Is this line ok? I think it should work with DirectX too, because off arb shader?
//Witout OpenGL these shaders won't work
if(!(driver->getDriverType()==video::EDT_OPENGL))
return;
Edit:
What is the difference between Local- Global- und AddImpact?

MfG
Scarabol
Irrlicht 1.7.2
Eclipse
Boost
Post Reply