[C++] PerPixelLighting with reflective water

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
abraham
Posts: 30
Joined: Wed Jul 19, 2006 8:56 am

Post by abraham »

the reflective soruce code has soo many errors in dev c++ aswell and i tried it in irrlicht 1.2
n7600gt 256mb ram 128bit
AMD 3200+
GA-K8NF-9 gigabyte
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

abraham wrote:the reflective soruce code has soo many errors in dev c++ aswell and i tried it in irrlicht 1.2
What do you mean by "soo many errors"? Post the build log.
a_haouchar
Posts: 97
Joined: Sat Oct 14, 2006 10:51 am
Location: Australia,melbourne

Post by a_haouchar »

the reason i didn post the build log becuase i thought this thread was finished

Image

thanks for replying and i got similar errors in vc++
ClownieTheMalicious
Posts: 28
Joined: Sun Sep 17, 2006 3:59 pm
Location: iraq

Post by ClownieTheMalicious »

im also getting errors..
vc2005EE says that you're attempting to access
a private member variable at line 126

Code: Select all

      services->setVertexShaderConstant("mWorldViewProj",&worldViewProj.M[0], 16);
specifically "M". defined in matrix4 as a private variable... I don't know why you're even using M[0] in the view projection matrix.

also, could you please give a possible workaround to the "DXbreaking" that irr 1.2 did that makes this code not work in DX.

Also, i can't get your code to compile for the life of me. mainly since idont know what to do about the private member accessing error...
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You should change the call &worldViewProj.M[0] to worldViewProj.pointer() in Irrlicht 1.3
ClownieTheMalicious
Posts: 28
Joined: Sun Sep 17, 2006 3:59 pm
Location: iraq

Post by ClownieTheMalicious »

thanks for the tip hybrid- but that still doesn't compile, nor explain why the compiled binary fails under irr1.1,1.2 and 1.3 dll's.

so, hybrid, the pointer() function returns that as a pointer- could you explain to me the technical reason as to why you no longer need the memory address ('&' of mWorldProjblah) and now only need the pointer? I'm not seeing how that works... sorry new to c++ logic.
I'm a java programmer... forgive me.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The array M is now private to the matrix class. So you cannot take the address of it anymore, nor can you access it any other way. You have to use the proper access methods (which allows us to track the usage and improve the testing for identity matrices).
Post Reply