ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Help with CopperCube
forum topic indicator Torchlight Shader - $100 USD
person icon
just_in_case
Moderator
Quote
2023-05-07 05:30:09

@Robbo, just created a showcase video to show you the current state of the shader with Flashlight (spotlight), there has been a need for a lot of improvements but yeah, I think the shader works pretty well, I have to think of a way to make it more user-friendly.

Watch the unlisted video here:- https://youtu.be/dgK5o95pWmM

person icon
Robbo
Guest
Quote
2023-05-07 07:59:07

Yes, it looks real good so far....just the final bits to have it work as much as you can using the existing editor setups I guess...

person icon
just_in_case
Moderator
Quote
2023-05-08 15:24:41

@Robbo, Here is another video showcasing the usage of irredit/irrlicht properties, the video showcases the usage of specular for Spotlight color, and it works great, and that's what I was going to do for most of the other parameters like ambient color, diffuse color, and specular color, and maybe I will use the shininess parameter for specular strength, and param1 for specular gloss, and param2 for normal strength. But still, there are other parameters that I want editable easily directly in the editor. For an advanced user like you, there are other alternatives as well, but I am more towards the editor parameters, other alternatives can be having extra behaviors that assign additional parameters to a node, and then use those parameters, but that will again increase the work for the end user to apply additional behaviors to every scene node that he wants to get affected by the shader.

Watch the video here with multiple materials that get affected with different flashlight colors, it looks kinda cool though.

https://youtu.be/I2f1amp74Bo

person icon
Robbo
Guest
Quote
2023-05-11 13:34:56

Impressive 'just_in_case' - great skill in CopperCube source code...

person icon
VP
Guest
Quote
2023-05-11 18:59:01

How about reshade's java torchlight? I was reportedly getting 333 FPS while running it, just uses existing lights and injects post.fx to the DirectX or OpenGL exe file to adjust existingbrighness data. Can assign any keymap to turn it on/off...

https://www.youtube.com/watch?v=...

File is called reshade torchlight.fx- code is available on github for it.

person icon
Robbo
Guest
Quote
2023-05-12 08:17:27

Yes, I am after something like what reshade does but I need it natively supported as my game is for commercial use - no game I know of ever relied on reshade just to be able to play the game....if it was for a free game then maybe fine.

Thanks anyway VP fore the video.

person icon
Guest
Guest
Quote
2023-05-12 08:38:56

Very excited for what Robbo could accomplish for his game. It's been a while since he updated some information about the game...

person icon
VP
Guest
Quote
2023-05-12 10:53:13

I know that - I meant, look at the java code on github and see if you can apply it to coppercube - as it uses existing lighting and just changes brightness data locally without affecting frame-rate.

The shader is 130 lines of code, freely available, might help you or [b]jusi_in_case[b/].

If you use java to write the shader for coppercube, obviously your game wont be dependent on reshade to inject the process at all, the processing would be a direct part of your game code.

It has brightness, distance, colour, spread settings.

person icon
guest_Robbo
Guest
Quote
2024-11-19 01:03:35

An update on this topic:

The DX9 fixed function pipeline (default non shader method) uses per vertex (not per pixel) shading to do its Spotlight calculations and this is why you sometimes see strange triangle cutoffs (not smooth) when you use large triangles as the other triangle next to it might be outside the spotlight cone.

The best method would be to replace all FFP to use a shader as can run it per pixel but best works when done in the engine itself as other isses come up with time delays in loading.

In case you didnt know using shadows in CC switches everything to use a HLSH shader instead of FFP but you notice it has a large frame rate drop also and so not my prefferd option.

One solution is to get access to the depth buffer (harder than you think with CC) and apply post processing inverted vignette adjusted for depth. No-one has been able to do this yet to my knowledge apart from injectors like Reshade.

The other staright forward solution is to just make more triangles so that you dont see those cutoffs so much and CC Editor can easily do this also using Polygon Editing / Split selected triangles.

This last option for now seem to solve my problems but with certain mesh made a certain way will have to split a few hundred triangles to look better....very do-able though and have verified this is much better now and allows you to just use the default Spotlight.

The outdoor terrain system also uses large triangles though so you would have to angle the light down when looking straight ahead just to see lighting on the surface. I will check this out more...

person icon
Sikes
Guest
Quote
2024-11-19 14:37:52

Ok bro keeping looking, we've got ur back

person icon
guest_Robbo
Guest
Quote
2024-11-29 09:51:57

Thanks Sikes.

Yes, I just tested out the default CC vertex spotlight on terrain and its fine actually.
Its totally usable so long as you adjust its height a bit up from the player height and angle down a bit helps too.

This code might be helpful:

var playerPos = ccbGetSceneNodeProperty(ccbGetActiveCamera(), "Position");

var mouseX = ccbGetMousePosX();
var mouseY = ccbGetMousePosY();
var end = ccbGet3DPosFrom2DPos(mouseX, mouseY);

// and limit max angle down to -0.90 on the y axis
end.y -=1000;
var dir = end.substract(playerPos);
dir.normalize();
ccbSetSceneNodeProperty(spotN, "Direction", dir.x, dir.y, dir.z);

person icon
bob
Guest
Quote
2024-11-30 03:37:37

robbo, can you please make a separate exe for your fog system for cc since I think that ugly fog is a bug and the regular users probably deserve that honestly... that said, i am fully onboard for a coop exe, i just don't want to step on toes... i have not figured out how to make source changes free yet but I am working on it... hint, hint

person icon
bob
Guest
Quote
2024-11-30 03:51:36

but i am honestly learning c++ now for this reason and i am slow out the gate but deadly when i am on emoji icon_blink

person icon
guest_Robbo
Guest
Quote
2024-12-05 00:06:43

Hi Bob.

Yes, the better fog system is already part of the exe I include with my new API - its turned on by default when you use my custom binary with the fog enabled.

You can also turn it on and off with:
ccbSetRangeFog(true/false);


Good luck with any new c++ improvements - I can add in if it works ok if you like...

I have added a new API to add sky domes and seems to work well (still testing). Shame was never added into the editor by Niko.

It wont be culled when using far plane clipping just like skyboxes which is how you want it...

person icon
bob
Guest
Quote
2024-12-10 21:16:35

hey robbo

so far i fixed the clipping issue of children (ad infinitum) of the fps camera and the on proximity returning the wrong current node. i couldn't get jic's launcher to work on my game project for some reason so i had to do it myself. needed the clipping fix for my fps game. next i am going to work on getting some sort of crouch together. i guess exposing the properties of the collision shape or something. i messed with the new irrlicht code and managed to recreate cc's default scene in it. messed with the skydome doing that. that should be a good option even if it doesn't work in the editor. cheers.


Create reply:










 

  

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


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






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