Help Please with Menu Shadow

Blitz3D Forums/Blitz3D Programming/Help Please with Menu Shadow

Yue(Posted 2010) [#1]





Hi, I need help please, the case is that I have a menu of options in 3D, where you change game options in this case the real-time shadows which perceives the change is due immediately.

I have four choices for shade, and I'm using Fastext, the case is a function that specifies the quality of the shadow CreateShadow (Quality Shadow) and I'm going crazy trying to show the change in real time, I regret not being able to explain better and I use a translator because my English is very bad.

The fact is that the function is outside the Repeat CreateShadow and not to update the value of the variable for this to work properly.

I appreciate the help you can give me possible.

Help!!! Plese i am now :(

Last edited 2010


_PJ_(Posted 2010) [#2]
It seems to me that you will need to make use of a Global variable to hold the "Quality Shadow" and this is what needs to be changed with the menu options.

In the code provided, you have the line

UpdateShadows(Camara_Menu,1.0)

Within this function, I suspect that you may need to ensure the Shadow system knows to use the variable for Quality Shadow.

OR if this can't work, then you would need to remove the existing shadow and repeat the CreateShadow() with the updated variable.


I hope this helps, I would provide an example, but I don't use FastExt or have those functions.
Maybe you could post those?


Yue(Posted 2010) [#3]
Hi, I appreciate your help, the code of the function that updates the shadows is this.

And the function that creates the shadow and the quality is this:



I mention that I tried to use Goto and Gosub to update the value of variable quality, but I have not always worked continuously with the first variable is zero for the quality of the shadow of lower quality (512 * 512)

A greeting and thanks again for helping me.


Yue(Posted 2010) [#4]
Tutorial Englis :(



Yue(Posted 2010) [#5]



I can not change the variable rate real-time shadows, at least I do but this does not affect the shadow changes, then I wonder if this can be done?, The support of the library or speak good English, nor I speak English, the language is Russian and Spanish I, therefore I am that my head off.

Last edited 2010


puki(Posted 2010) [#6]
When you want to change the shadow resolution, you will need to rebuild the shadow texture with CreateShadow - I don't see you doing that in the above code.


So, I think you will need to first free the current shadows (as they are the wrong resolution); failing to do so will leave the old shadows on the texture:

FreeShadows


Rebuild the the shadows to the required resolution:

CreateShadow X (X = new resolution)


Apply the new shadows to the old ShadowTexture:

ShadowTexture = ShadowTexture()


This, as far as I know, would be the basic steps to take to rebuild the shadows to a different resolution/quality.


puki(Posted 2010) [#7]
Look for the demo called 'ShadowsSimple_TweenOther.bb'

Add into the main loop:
	If KeyHit(2)
		FreeShadows
		CreateShadow 3
		ShadowTexture = ShadowTexture()
		CreateGame()
	EndIf 


Then press the '1' key to see the resolution change in real-time.

This is just a quick way of doing it (to demonstrate) - you will probably need to delete entities and recreate them prior to doing it this way.


Yue(Posted 2010) [#8]
Puki Hi, I greatly appreciate the help you gave me, and it is complicated I use a translator when the word in English Brush, I translated into Spanish in the brush, and brush my tongue is something to fix her hair or cleaned teeth ... In order to comment you have given me a light on this, but I have a problem is that calling the new shadow re-creates the world, and therefore the use ClearWorld tells me that since the respective texture for the shadow is not exists. But I hope to fix it and just drink coffee ;)

A greeting.


Yue(Posted 2010) [#9]
This is impossible, unfortunately I have tried what is in my power, the idea was to create a real-time menu where you notice the change of the shadows, so we will retake this course, or do not deliver what sufientes in Blitz or just the author the libs can not take 5 minutes to do a simple example.


Yue(Posted 2010) [#10]
I've done gentlemen
:) One of my greatest limitations is the language and the only way to learn is trial and error.

A greeting.

=)