Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Dark Lights and Dynamic Lights

Author
Message
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 27th Mar 2016 13:31
Hello community,

Anyone know how can I add Dynamic Lights over Dark Lights rendered lights? I can't seem to make them work even though i've set the stage of DL and Dynamic Lights enabled.

Thank You!
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 28th Mar 2016 22:26
Quote: "I can't seem to make them work even though i've set the stage of DL and Dynamic Lights enabled."


You might be able to do it using the set blend mapping on commands. Alternatively, the simplest solution would be to use a shader and simply add the dynamic lighting to the lightmap value before blending with the main texture.

Perhaps you could give us a simple short snippet showing what you tried?

You might need to use the advanced, undocumented, versions of the set blend mapping on command. These are briefly illustrated in Lee's Lerping Textures snippet in your DBPro/Projects/Snippets folder. [Actually, as I write this I think the standard documented version of the command might be sufficient - I'll experiment and report back. ]


Powered by Free Banners
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 29th Mar 2016 00:28 Edited at: 30th Mar 2016 12:46
(*** Please see my next post where a new demo has been posted. The new code makes the demo more user friendly and corrects some errors. ***)

Done some testing and you can use the standard blending commands. Here's some sample code I used for testing. It's not quite finished because I can't quite get one case working as expected. (I've probably made a simple error - but it's late now. )

Press and hold keys 1,2, 3 or 4 to get different combinations of lighting and lightmapping. You'll need to supply your own object and textures of course.



Powered by Free Banners
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 30th Mar 2016 12:54 Edited at: 30th Mar 2016 12:58
Here's a new version of the demo. Most of the options work as intended now.

I've added two new options so there are now 6 options altogether. I've also attached a copy of the media files so you can run my code and see what's happening.

I think option 1 is the main option you need.



Powered by Free Banners

Attachments

Login to view attachments
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 30th Mar 2016 23:11
Hello Green Gandalf,

Thank you for your code and your patience to explain and sorry for the delay.

In my editor, i don't import the lightmap texture since it makes hundreds of images for the models in my scene. Thats why i didn't used set blend mapping on. If i have a lot more textures from light mapping how can i set the blend mapping with those?

Thank you!
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 31st Mar 2016 11:45
Quote: "In my editor, i don't import the lightmap texture since it makes hundreds of images for the models in my scene. Thats why i didn't used set blend mapping on. If i have a lot more textures from light mapping how can i set the blend mapping with those?"


I had a horrible feeling that would be an issue.

The only solution I can think of is to use a shader. If you want only a few dynamic lights it should be easy to add both diffuse and specular effects to a lightmapped object - regardless of how many lightmap images there are. Would such a solution be acceptable?


Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 31st Mar 2016 13:43
Hello Green Gandalf,

Please , really, if you can make a shader( i saw that you are good at shaders ) that supports both light mapping from dark lights and dynamic lights from darkbasic pro, that will be an extraordinary thing(and a birthday gift, tomorrow is!) ) !

You are awesome!

Thank You!
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 31st Mar 2016 14:53
You're welcome - and I'll try to have it ready for tomorrow.


Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 31st Mar 2016 16:41
Thank you very much again Green Gandalf!!!
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 31st Mar 2016 16:49
And here it is! (I decided tomorrow might not be a good day to post it. )

The results look far better than seems to be possible using the built in blend mapping and lighting commands. The specular reflection now looks much better.

[Actually, I knew this already but wanted to see how far I could push DBPro on its own. ]

Sample code using my media already posted - note that the textures are automatically assigned to the right place when the object is loaded so it shouldn't matter how many lightmap textures there are.

Shader file attached.

Any issues, let me know.




Powered by Free Banners

Attachments

Login to view attachments
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 31st Mar 2016 23:48
Hello Green Gandalf,

Thank you very much for this example! I have a few questions regarding the shader. Is this shader able to have normal mapping?
How many lights can this shader have?
The third question is in general: If we apply this shader and remove the shader lights, can we apply darkbasic professional dynamic lighting by the command: make light ? (i think not but i want to be sure)

Thank you again!
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Apr 2016 00:24
Quote: "Is this shader able to have normal mapping?"


Not at the moment - it would need additional code and the object would need a normal map. Also, you could only have normal mapping with the dynamic lights - not the lights in the lightmap. Ideally the lightmap would already take normal mapping into account - not sure off-hand whether that feature is available (I doubt it).

Quote: "How many lights can this shader have?"


One at the moment. It would need additional code for the extra lights. This could be implemented using the extra features included with Dark Shader and recent versions of DBPro (but not, as far as I know, the free open source version). How many lights would you want? Four dynamic lights should be easy to implement.

Quote: "If we apply this shader and remove the shader lights, can we apply darkbasic professional dynamic lighting by the command: make light ? (i think not but i want to be sure)"


No. If you apply a shader then the shader must apply the lighting.


Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 1st Apr 2016 11:10
Hello Green Gandalf,

To tell you the full thing that i want for my engine to better understand :

In my engine, i place lights in the scene, when a light is clicked represented by an object, a light appears for better placement to see the range the colour and how it pastes into the surfaces, after right clicking for exiting the selection, the light dissappears, so its a dynamic light. Good, after that we build the lights, the static lights. The dynamic light does not appear anymore. You had a great idea by the shader so at the moment i want for that light to appear and dissappear when needed. I also really really want to have normal mapping with light mapping, that will be the cherry on top of the cake. (I will put you in my credits on my engine, i intend to sell it. screenshot attached)
Alex Matei CEO
www.alexmatei.com

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Apr 2016 11:50
Quote: "In my engine, i place lights in the scene, when a light is clicked represented by an object, a light appears for better placement to see the range the colour and how it pastes into the surfaces, after right clicking for exiting the selection, the light dissappears, so its a dynamic light. Good, after that we build the lights, the static lights. The dynamic light does not appear anymore."


Thanks for the background info.

Are you saying that you merely want the dynamic light as part of the world editing process? In other words, are you building your world in stages and at various points during the editing process recalculating the light maps? So, for example, you might have decided on the position, colour and range of, say, 6 lights and want to add one more but have already calculated the light map for the 6 lights and just want to see how the 7th light would look before updating the lightmap. If that is the case then you might want to add a few lights, e.g. no more than 4 say, before updating the lightmap. If you only want to work with one at a time then you can use the shader I've already given you - just switch technique as in the demo when you add or delete the temporary dynamic light.. You might want more than one temporary dynamic light so you can see how they interact before committing yourself to recalculating the lightmap. If that is the case then I doubt you'd really need as many as four - just two might be sufficient. Let me know what you think and I'll add the extra code if necessary.

Sounds like an interesting project.

Quote: "I will put you in my credits on my engine"


Thanks.


Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 1st Apr 2016 16:39
Hi Green Gandalf,

I will try with the code that you gave to me to use one light. Let me explain one thing, because i tested your shader. First of all, how can i correctly assign the color of the light? My interface exports RGB Values I tried with them but the light went choppy at movement and extremely biright. As for the range the same thing, i am using numbers from 1 to 1000 as range.

Also , please , if you can, apply a normal map techinque to the shader.

PS: Please if you want your full name on credits, PM me, else, I will put Green Gandalf (or both)

Thank You again!!!
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Apr 2016 18:41
Quote: " First of all, how can i correctly assign the color of the light? My interface exports RGB Values I tried with them but the light went choppy at movement and extremely biright. As for the range the same thing, i am using numbers from 1 to 1000 as range."


Colours are coded as floats in the range 0 to 1 for shaders, not 0 to 255. Also, light range is passed as its reciprocal. The relevant lines in the demo are:



which might be more clearly coded as something like:



Make sure you are using float arithmetic at critical points, otherwise a range of 50 for example might be applied as an infinite range (because 1/50 would be returned as 0).

Hope this helps.

Quote: "Also , please , if you can, apply a normal map techinque to the shader."


That's only worth doing if you can do it with the lightmapping as well. Otherwise you'll only see the normal mapping in the editor using the current temporary directional light. I doubt there would be much point doing that. Or have I misunderstood?


Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 1st Apr 2016 19:10
Sure, i will try using floats for those values.

As for the normal mapping, i saw a post from you where you made a shader that enabled normal mapping and light mapping at the same time and it looked so good indeed. So it was an object, normal mapping, the NM directional light and the lightmap texture combined.
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Apr 2016 19:24
Quote: "As for the normal mapping, i saw a post from you where you made a shader that enabled normal mapping and light mapping at the same time and it looked so good indeed. So it was an object, normal mapping, the NM directional light and the lightmap texture combined."


Yes - but that was not for a temporary dynamic light. You could try it if you like but I suspect it's rather old and could be bugged (). Was it in a thread on its own or was it buried in another thread? I ought to have a copy of it somewhere ...


Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 1st Apr 2016 20:33
Here it is: https://forum.thegamecreators.com/thread/194365



I think there is a possibility to combine these effects somehow in any way?

Thank you!
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Apr 2016 23:28
Quote: "Here it is: https://forum.thegamecreators.com/thread/194365"


Thanks for the link!

Quote: "I think there is a possibility to combine these effects somehow in any way?"


I'm not sure. You probably need a separate normal map for each base texture - and I still don't understand how you expect to use them when you've deleted your dynamic lights.


Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 2nd Apr 2016 09:32
Well, i think there will be a possibility if we have a directional light and a point light(temporary light) at the same time.
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 2nd Apr 2016 15:10 Edited at: 2nd Apr 2016 15:14
Here's a modified version of Broken_Code's demo from the thread you found. It applies a single directional light with bump mapping to lightmapped objects.

Run it once to create the lightmaps and objects, then you can change the value of VIEW_ONLY to 1 when you next run it. (Corrected typos)

See if that is useful.

Edit: Forgot to hit the Upload file button.


Powered by Free Banners

Attachments

Login to view attachments
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 2nd Apr 2016 16:14
Hello Green Gandalf,

This is EXACTLY what I want, except that the temporary light that we talked about is missing. One question I have regarding this shader: Why do we load the lightmap texture instead of doing it like in the last shader for the temporary light that you sent to me? Another one: Is it possible to apply the temporary light here in this shader?

Thank you so very much!
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 2nd Apr 2016 17:11
Quote: " except that the temporary light that we talked about is missing."


You need to decide how you want the normal mapping to work. You can have it for a dynamic light which can be directional or positional (the demo I posted today is for a directional light for the simple reason that was what Broken_Code's demo used ). However, the normal mapping will be lost when you delete the temporary light. Do you want a permanent directional light in your editor so you can have some form of normal mapping with an ordinary, i.e. non-normal mapped, dynamic positional light for the temporary light? That option makes sense to me otherwise you'll get complaints from people who want to know why a temporary light is bump mapped in the editor but not in the final saved version of their level.

In short, I am suggesting you have two dynamic lights:

1. a permanent directional light for use in both the editor and the final application so you can get a limited bumpmapped effect;
2. a temporary positional light for use in the editor without bumpmapping so you can add it to the lightmap when you're satisfied with its position, etc.

If that makes sense to you I can make the changes to the shader.

Quote: "Why do we load the lightmap texture instead of doing it like in the last shader for the temporary light that you sent to me?"


No particular reason. I'll see if I can do it a different way.

Quote: "Another one: Is it possible to apply the temporary light here in this shader?"


Yes - as discussed above.


Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 3rd Apr 2016 09:52
Hello Green Gandalf,

Ok, if we cannot add the directional and the positional, then lets add just the directional

Thank You!
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 3rd Apr 2016 11:19
Quote: "Ok, if we cannot add the directional and the positional"


I think you misunderstand me. You can have both very easily. I was merely wondering how you planned to use them - and hence whether there was any point having both.

Quote: " then lets add just the directional "


You already have two shaders from me: one using a positional light without bump mapping and the other a directional light with bump mapping. I'm a bit confused about what you want now.


Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 3rd Apr 2016 15:01 Edited at: 3rd Apr 2016 15:04
Sorry i think i misunderstood you, you are right So its possible to have both. From that shader that has normal mapping can you make to automatically retrieve the lightmap and without loading the actual texture

Thank you so much for helping!

Edit: The temp light is for previewing the light that we want to add and the directional as the main world light
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 3rd Apr 2016 15:22
OK. I'll see what I can do. Might be tomorrow though.


Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 3rd Apr 2016 16:05
Ok,

Sure, take your time I can't wait to see the results!

Thank you again!!!
Alex Matei CEO
www.alexmatei.com
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 5th Apr 2016 08:51
Hello Green Gandalf,

Any success?

Thank you!
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 5th Apr 2016 11:56
Sorry! Too many distractions on this forum.

You have not been forgotten.


Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 5th Apr 2016 19:21
Ok,

I will wait.

Thank You!
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 5th Apr 2016 20:31
I'm working on a new demo for you this evening - in between preparing supper and posting on other threads. I'm changing the demo a bit to make the steps more obvious - and to remove unnecessary stuff.


Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 5th Apr 2016 20:39
That sounds really great!

I am staying here all the time! I can't wait to see the results!

Enjoy your supper!
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 5th Apr 2016 20:48
Quote: "Enjoy your supper!"


I hope so - it's an experimental dish and my experiments don't always work ... fortunately Mrs Gandalf is very forgiving.


Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 5th Apr 2016 21:55
Well hopefully it will turn out tasty!
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Apr 2016 00:11
It did, thanks.

Here's the new demo. I hope it's almost self-explanatory.

When you run the demo the following steps occur:

1. the objects are lightmapped.
2. the objects are displayed as normal without the shader
3. if you press <space> you then see the objects bumpmapped with a single directional light and also lit with an initially black positional light (black = invisible);
4. then press 1 or 2 to turn the additional positional light on or off.

The only light which is bumpmapped is the directional light.
I haven't had time to thoroughly check it but I think the main steps are OK and ready for you to test.

Have fun!


Powered by Free Banners

Attachments

Login to view attachments
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 6th Apr 2016 16:17
Hello Green Gandalf,

The shader works much better that i have in mind and the quality is very very good indeed!

Is it possible to render multiple times?

I tried to render multiple times but there was a problem, the object dissappears. I am deleting the shader and re applying all the textures of the objects plus the normal mapping of course but the object does not appear in the scene any more.

Thank You!
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Apr 2016 18:44
Quote: "Is it possible to render multiple times?

I tried to render multiple times but there was a problem, the object dissappears. I am deleting the shader and re applying all the textures of the objects plus the normal mapping of course but the object does not appear in the scene any more."


Do you mean you want to recalculate the lightmaps? I'm not sure why you want to delete the shader and then apply the normal maps.

I know there are problems associated with deleting effects from objects but I'm not sure I can suggest anything till I know exactly what you're trying to do. Can you illustrate the problem using a simple demo such as one of those I posted earlier?

Quote: "The shader works much better that i have in mind and the quality is very very good indeed!"


That at least is good news.


Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 6th Apr 2016 19:52
I will try to see how can I manage to recreate this, its the matter of placing the code in the loop and when pressing a key to re render the lights, i will try that.
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Apr 2016 20:09
Quote: " when pressing a key to re render the lights, i will try that"


So will I. It wouldn't surprise me if there was a problem trying to do that.


Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 6th Apr 2016 22:28
Indeed
Alex Matei CEO
www.alexmatei.com
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 7th Apr 2016 10:24
Hello Green Gandalf,

Here is the example with a bit from my engine code.

Thank You!
Alex Matei CEO
www.alexmatei.com

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Apr 2016 16:12
Thanks for the demo.

I can see there is a problem - no idea what the cause or solution is yet. I wonder if the applied shader is interfering with the lightmapping process somehow. As you say the objects seem to disappear - and although the lightmap is created it is blank.


Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 7th Apr 2016 19:24
Well, yes, i tested also with the colllision, the object deletes itself or somehow. Maybe if somehow we can get the object to remove from its properties the shader itself and then re apply it might reset the whole thing. From its properties i mean from the text piece of the object since its a .x it can be edited with notepad at some parametres.
Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Apr 2016 20:43 Edited at: 7th Apr 2016 20:49
Quote: "From its properties i mean from the text piece of the object since its a .x"


I very much doubt that is possible - the object will be stored in DBPro's internal format modified in some unknown way by the lightmapping process and the set object effect command. I'll try to find time to do some more experimenting to see if I can find a way around the problem. I know that objects without shaders applied can easily be lightmapped again. It may be a matter of saving and reloading the objects or something like that. Another possibility is to have another look at the blend mapping commands - I've just stumbled across an old demo of mine which shows one way of getting bumpmapping without a shader.


Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 7th Apr 2016 22:50
I'm very interested in your ideas of resolving this problem indeed! I thought about deleting objects and reloading them, i will try that in the meantime.
Alex Matei CEO
www.alexmatei.com
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Apr 2016 02:09
It may not be related, but I've noticed that if I change a texture that is applied to a shaded object, then it that texture goes black until I re-apply it. So if I change a texture, I re-apply the texture layers and the shader to the object. I need to do memblock mods to the textures a lot of the time, so I have to save the texture and reload it to get mipmaps recalculated... otherwise I get ghost mipmaps of old textures in the distance which just messes with your brain.

Anyhoo, I wonder if the object isn't actually deleted, but rather it's pure alpha - perhaps the shader relies on a texture that is gone (like the lightmap), if the calculated light texture has 0 alpha, then it might just be invisible - maybe worth trying re-applying textures and the shader when recalculating light maps.
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 8th Apr 2016 09:22
Hello VanB,

Indeed, but i am already deleting the diffuse and the normal from the object(and the effect) when the rendering starts and after that, re applying them

Thank you!
Alex Matei CEO
www.alexmatei.com
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 8th Apr 2016 10:21
Ok guys,

I managed to resolve the problem, please find the attached project in this message. I have a question though, isn't this kind of method by deleting the object and reloading it, consumes a lot of virtual memory and it risks of crashing the application?

Thank You!
Alex Matei CEO
www.alexmatei.com

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-03-29 10:42:10
Your offset time is: 2024-03-29 10:42:10