Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
source code spotlight now working - sort of..

Robbo
Guest
Quote
2023-12-10 08:27:15

In my never ending quest for a proper spotlight that works for all objects and loads and runs at acceptable speeds:

I now have something that works - of sorts...

I have butchered the HLSL shadows shader source code of Coppercube and now have a working spotlight instead of shadows.

I just have a problem getting the camera position and target to update into the shader. I have been trying to send these from the 'IMaterialRendererServices' class in the CSceneManger.cpp file to no avail as just cant seem to access the Active Camera or get the Scene Manager as its not found.

Any suggestions anyone ?? - JIC ??


Robbo
Guest
Quote
2023-12-12 01:48:25

In case anyone here ever looks to edit CC source - I found the answer:

create another static variable and link that to class variable ActiveCamera:

static ICameraSceneNode* CurrentCamera = CSceneManager::ActiveCamera;

then inside another class access it with:
// feed camera into shader - Robbo added
//! had to create static variable outside of CSceneManger

irr::scene::ICameraSceneNode* cam = irr::scene::CurrentCamera;
irr::core::vector3df cameraPos = cam->getPosition();
irr::core::vector3df cameraTgt = cam->getTarget();

services->setVertexShaderConstant("CamPos", reinterpret_cast<f32*>(&cameraPos), 3);

services->setVertexShaderConstant("CamTgt", reinterpret_cast<f32*>(&cameraTgt), 3);


Guest
Guest
Quote
2023-12-12 23:35:42

Good job, Robbo! With your growing skills in source code editing, maybe you could also try to create some custom launcher to better protect CooperCube against project sniffing?


Robbo
Guest
Quote
2023-12-13 00:37:29

Cheers - well yeah, that one might be possible as CC source from Irrlicht has a load from zip file function and I am guessing save to zip also....
whether or not this is password protected not sure about that...


Guest
Guest
Quote
2023-12-13 06:11:57

Yeah, @just_in_case said, that he is soon going to leave CC community and has no plans on upgrading CC instead he wants to focus on his own game engine. I don't know what's wrong between you two, but he mentioned that he is soon going to leave the community because of growing haters and he mentioned you as a hater too.

So now we are relying upon you only for custom updates, I hope you will also fix other issues like Z-order rendering for transparent materials, better shadows, multi threaded lightmaps and a new renderer.

Thanks!!


Robbo
Guest
Quote
2023-12-13 06:52:11

Well JIC will do his own thing as he has supported the community for along time as and its clear Niko doesn't want to do much work on CC at all...its very clear of that so no wonder others like JIC think to move on as why do all that work only to have it wasted when its not added into the engine by the developer...even a year after sending to him..

I am no hater of JIC at all....we had a disagreement on something once but was a long time ago with both of us not able to get what we wanted out of some work done so neither of us were happy with the result but that's life and I have moved on long ago...I don't hold grudges. Live and learn.

Some others are very sensitive and hold onto grudges maybe but I don't. I think its definitely others you are talking about I have seen that like to attack JIC - I don't. Actually I have commended him countless times and only once said something negative about his attitude on this forum when it was needed.

I will see if he is willing to combine the code of each of us so the community can benefit.

Either way CC is a very old technology with so many limitations but with some work can still be useable.

I will have a look at what you mentioned but cant promise anything...so many improvements could be added into CC...

I do actually have a working spotlight now with CC source code for the terrain but for all that, there is some problem with 3d mesh objects not working right....game engines are complex beasts that's for sure...


Robbo
Guest
Quote
2023-12-13 08:11:07

Actually just saw JIC new irrlicht based engine "KHEL" editor so looks like he is still interested in supporting the community - only with more frequent updates and changes unlike another engine I know of...if you know what I mean.

I say good luck to him and hope he can link up all the needed functions within the Irrlicht/ CC code already to his new editor...

Looks good...


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internati?nal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact