Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Torchlight Shader - $100 USD

just_in_case
Moderator
Quote
2023-04-08 00:36:26

@sakura, I also have a free version of the same shader which does basic lighting on my website neophyte.cf

https://neophyte.cf/ccb_shader_c...

@Robbo, my shader extension can be extended to use unlimited amount of light, and a directional light and flash light can also be incorporated into it as well, but it will still require you to ditch all the inbuilt lighting, and then totally rely on shader lighting for the whole scene and I think I can add shadowmapping as well but I am not sure about that.

I will try to update my shader a bit today, so that you can atleast have a flashlight along with other lights.
though it will still break the inbuilt lighting system.


VP
Guest
Quote
2023-04-08 02:49:24

Every fewseconds(20ms) shoot (bullet) dummynode.
Every fewseconds(20ms) change position of point light (0,0,0) relative tolast bulet impact.

Give the bullet a distance longenough to reach into the distance and a speed of 10 or 100 to make sure it hits the maxdistance within the 20ms loop.

Then use a transparent.png gradient texture attached to a cone object to give the illusion of a torch beam - the light will always be moved to the wall or anything that has collision enabled.


Robbo
Guest
Quote
2023-04-08 04:43:06

wrote:
I will try to update my shader a bit today, so that you can at least have a flashlight along with other lights.
though it will still break the inbuilt lighting system.


Sounds good if your custom shader can include the pixel shader torchlight effect and have 10 or more point/spotlights, I would be interested in that for sure. In that case wont need the default CopperCube lighting system.

Hopefully the performance is still good though as it would all be in javascript instead of C++ though I would accept some losses for the benefits gained.


hadoken
Guest
Quote
2023-04-08 07:08:38

For example recently @hadoken shared the spritesheet behavior, which was already in the community but then just_in_case posted an update to his version. For me it just feels like a waste of time, if you have to develop something then why do you develop it after someone has already released it


@Guest, you are spreading false facts here:

When I released my spritesheet extension, it was made for targeting OpenGL, which did not exist before. Shure just_in_case had already done it, but for DirectX only.

There are people (e.g Linux/Wine users) how prefer using CopperCube with OpenGL over DirectX for a better performance.

So my contribution was new, with real value for the community, besides where can I find your contributions (or even a real nickname, coward)? I might spend some bucks I the where worth it?

Please stick to the truth and be more professional next time you're judging things.


hadoken
Guest
Quote
2023-04-08 09:18:40

@Guest

Tell me if your extension doesn't do the same thing as using the command to check the collision of a ray with a scene node.


This should help prove your assumption wrong:

The command must be used by people who know programming/scripting. So anyone who doesn't know how to script in CopperCube has no access to collision line checking in the editor. With my extension the non-coding users do have access. Simple as that for two little dollars which not only have to pay the extension creation but support for more to come from my time and effort to help the CopperCube community with feature development.

Also my Reaper example shall prove your shallow assumptions wrong:

Imagine you have an enemy ai with its enemy ai behavior. Then you clone the enemy at runtime. Multiple clones will bear the exact enemy ai behavior of the original one. Then things can get difficult for telling which of the clones should be taken out of the game when having zero health. To keep track which one has to be deleted, it can easily be done from within the enemy ai behavior script. But when a scene node decides to delete itself CoppetCube crashes from my experience. Deleting nodes must be executed from another node to prevent crashes. Now my Reaper extension comes in giving a scene node the possibility to send itself from its own script to death and be deleted. That my friend would not be possible with CopperCube's built-in delete scene node only.

And back to the spritesheet example: There was no OpenGL compatible one before mine. Thus people driving CopperCube with OpenGL had no possibility for playing spritesheets before. Skipping information is against truth. Sam invented his excellent Third person extension giving more features like free mouse look, etc. Would you say that was a bad idea because CopperCube already had a (lousy) third person controller? Did he waste time and effort in your eyes?

Last but not least I use my code as anyone else is allowed with CopperCube's free to use API which is not stealing at all. Anyone is free to use commands and variables for CopperCube. If you're trying to accuse others for something like identical code blocks or high level unique concepts theft then please prove it carefully.

Thanks for appreciating my two designer extensions nevertheless. I'm not that offended by your posts but feel the need to clarify things so that other users here can make their views out of more than one side.


sakura
Registered User
Quote
2023-04-08 09:19:31

wrote:
@sakura, I also have a free version of the same shader which does basic lighting on my website neophyte.cf

https://neophyte.cf/ccb_shader_c...

@Robbo, my shader extension can be extended to use unlimited amount of light, and a directional light and flash light can also be incorporated into it as well, but it will still require you to ditch all the inbuilt lighting, and then totally rely on shader lighting for the whole scene and I think I can add shadowmapping as well but I am not sure about that.

I will try to update my shader a bit today, so that you can atleast have a flashlight along with other lights.
though it will still break the inbuilt lighting system.


Wow, so it looks like I don't need to develop duplicate things anymore

It's great to have the most basic features available to the community. I'm looking forward to adding shadow mapping.

I'm looking forward to you adding shadow mapping so that the lighting system is complete.


sakura
Registered User
Quote
2023-04-08 09:20:33

Robbo wrote:
So how many point/spot lights can be used at the same time ?

CopperCube is limited to 10 (without normal maps) or only 4 with normal maps while just_in_case upgraded it to 5 with his version using normal maps.

Because of this limitation I got rid of all normal maps and now have access to 10 lights at the same time - do you have this or better maybe ? and has flashlight ?


Theoretically an unlimited amount of lights are supported because it's a shader, you don't even really need to add a light node, I just need the coordinates of the light.

Regarding performance, if your game is an indoor scene, you only need to illuminate where the player can see.


sakura
Registered User
Quote
2023-04-08 09:22:02

Robbo wrote:
Sounds good if your custom shader can include the pixel shader torchlight effect and have 10 or more point/spotlights, I would be interested in that for sure. In that case wont need the default CopperCube lighting system.

Hopefully the performance is still good though as it would all be in javascript instead of C++ though I would accept some losses for the benefits gained.


There are many other benefits to abandoning CC's lighting system, such as developing indirect light, where light is reflected from the ground, just like global illumination.


VP
Guest
Quote
2023-04-10 18:39:55

Did you try the method I mentioned with every few seconds, shoot - then move the light to the last bullet impact? It's really simple and works quite well with no performance lag.

If you've not tried it, here's a quick example (my old FPS shooter prototype) - It originally had a red glow for the LASER dot, but I enabled a white light so it looks like a torch example instead, not sure if it's what you're asking for?

Feel free to use the idea with no payment/accreditation required - let me know if you want me to tweak it into a torch beam for you, or just ignore if not relevant.

You could toggle a beam png and the "every few seconds" on off with a keypress, to complete the torch-beam illusion - just attach the action to the 2D plane so when the beam is visible, the light is active and when the beam is not visible, the action is disabled.

Also, notice the subtle specular effect? A red light-halo shining wherever the LASER dot hits the wall? It's just a sphere with a dithered texture I made, set to rotate on x/y axes - You can just re-colour it white (and enlarge it a bit) to suit a torch halo instead of a the red LASER dot

https://veganpete.itch.io/fps-sh...


Robbo
Guest
Quote
2023-04-13 10:18:47

Thanks VP and others with alternative suggestions but I have tried things similar to that but they just don't show as a true torch light effect - its just not the same.

How is your shader code 'just_in_case" you mentioned that you will have another look at implementing your pixel shader into ?


just_in_case
Moderator
Quote
2023-04-13 11:18:50

Hie @Robbo, yeah I did updated the shader code on my local machine and it does work with the flashlight, I also managed to do not properly working shadowmapping as well.
There are still issues with the shader, the issue is that you have to manually assign shader to all the objects that you want to have different properties for the shader.
I did made an early adaptation of applying the shader to all the node at once but, the light data remains the same that means, it will use same specular strength, glosiness and other properties for all the objects and materials.
in order to make it work with different properties for different objects, we need to to create multiple materials or instances of the shader.

I am busy with my exams that will about to end on 21 april, so I am getting a very little bit time to work on anything.

The shadow mapping also has one issue, the shadows shows on the object itself rather then showing on the global object.

for example projected shadow of T-rex will show on T-rex, instead of the floor, will try to figure out how to fix that, but atleast I got started with some sort of shadow mapping.

Will let you know and will post the updated shader, if I will be able to tweak it further and improve it more, however the spotlight works just fine along with the other lights.


Robbo
Guest
Quote
2023-04-16 13:52:46

Ok thanks - lets pick this up after your exams then...

So can it have 10+ point/spot lights with the pixel shader all working together ?


just_in_case
Moderator
Quote
2023-04-19 03:02:26

@Robbo, yes it can have 10+ point lights and can have more, But I have added only one Flashlight Support, Wish if there were an option to add custom properties to the objects, that can be accessed by behaviors and extensions later on. So that, we can simply Toggle the light to point or spot or something else.
Also, I am still trying to figure out to find a way to have more control over the light settings.

It already gets applied to all the objects in one click, but as I mentioned earlier, being a single shader and applied on multiple objects that can have different light settings like Normal strength, Specular gloss, and all, requires a bit of logic and on top of that, multiple objects can have multiple materials as well, so to have all of them their own individual properties is something that I want to work on.
Otherwise one has to apply the shader manually to each object.

Also, I was able to do the inbuilt light calculations as well, Meaning I don't have to deal with light data, I can utilize the data sent by CC already, but that is limited to 4 lights and has bugs, but does work as the original lights of Coppercube. Actually, it is using the original technique of light shading of Coppercube. So I am sticking to using my own implementation of lights, instead of using an inbuilt ones as they are limited to 4 lights and because of bugs, I am ditching them.


Robbo
Guest
Quote
2023-05-02 02:10:14

Sound very promising - can I have a look at what you have come up with so far using a pixel shader flashlight effect ?


just_in_case
Moderator
Quote
2023-05-02 02:33:12

@Robbo, I don't know if you use Discord that much or not, but I texted you there a couple of days ago regarding the shader if you can check the texts there? So that I can pick it up from where I left it off.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Intern?tional" (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